mirror of
https://github.com/django/django.git
synced 2025-07-13 16:25:13 +00:00
Fixed #32456 -- Added dbshell support for specifying a password file on PostgreSQL.
This commit is contained in:
parent
9f125fce79
commit
8380fe08a0
4 changed files with 48 additions and 6 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue