mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #29501 -- Allowed dbshell to pass options to underlying tool.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user