mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #32456 -- Added dbshell support for specifying a password file on PostgreSQL.
This commit is contained in:
committed by
Mariusz Felisiak
parent
9f125fce79
commit
8380fe08a0
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user