mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #29501 -- Allowed dbshell to pass options to underlying tool.
This commit is contained in:
parent
8e8c3f964e
commit
5b884d45ac
13 changed files with 117 additions and 21 deletions
|
@ -76,5 +76,23 @@ class MySqlDbshellCommandTestCase(SimpleTestCase):
|
|||
},
|
||||
}))
|
||||
|
||||
def get_command_line_arguments(self, connection_settings):
|
||||
return DatabaseClient.settings_to_cmd_args(connection_settings)
|
||||
def test_parameters(self):
|
||||
self.assertEqual(
|
||||
['mysql', 'somedbname', '--help'],
|
||||
self.get_command_line_arguments(
|
||||
{
|
||||
'NAME': 'somedbname',
|
||||
'USER': None,
|
||||
'PASSWORD': None,
|
||||
'HOST': None,
|
||||
'PORT': None,
|
||||
'OPTIONS': {},
|
||||
},
|
||||
['--help'],
|
||||
),
|
||||
)
|
||||
|
||||
def get_command_line_arguments(self, connection_settings, parameters=None):
|
||||
if parameters is None:
|
||||
parameters = []
|
||||
return DatabaseClient.settings_to_cmd_args(connection_settings, parameters)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue