summaryrefslogtreecommitdiff
path: root/tests/dbshell/test_postgresql.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dbshell/test_postgresql.py')
-rw-r--r--tests/dbshell/test_postgresql.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/dbshell/test_postgresql.py b/tests/dbshell/test_postgresql.py
index 3345035a24..a96acac6f1 100644
--- a/tests/dbshell/test_postgresql.py
+++ b/tests/dbshell/test_postgresql.py
@@ -73,6 +73,34 @@ class PostgreSqlDbshellCommandTestCase(SimpleTestCase):
(['psql'], {'PGSERVICE': 'django_test'}),
)
+ def test_passfile(self):
+ self.assertEqual(
+ self.settings_to_cmd_args_env({
+ 'NAME': 'dbname',
+ 'USER': 'someuser',
+ 'HOST': 'somehost',
+ 'PORT': '444',
+ 'OPTIONS': {
+ 'passfile': '~/.custompgpass',
+ },
+ }),
+ (
+ ['psql', '-U', 'someuser', '-h', 'somehost', '-p', '444', 'dbname'],
+ {'PGPASSFILE': '~/.custompgpass'},
+ ),
+ )
+ self.assertEqual(
+ self.settings_to_cmd_args_env({
+ 'OPTIONS': {
+ 'service': 'django_test',
+ 'passfile': '~/.custompgpass',
+ },
+ }),
+ (
+ ['psql'], {'PGSERVICE': 'django_test', 'PGPASSFILE': '~/.custompgpass'},
+ ),
+ )
+
def test_column(self):
self.assertEqual(
self.settings_to_cmd_args_env({