Fixed #29560 -- Added --force-color management command option.

This commit is contained in:
Hasan Ramezani 2018-07-22 21:41:47 +04:30 committed by Tim Graham
parent de8eb07c7a
commit 5195b99e2c
6 changed files with 103 additions and 47 deletions

View file

@ -179,18 +179,18 @@ class CommandTests(SimpleTestCase):
def test_call_command_unrecognized_option(self):
msg = (
'Unknown option(s) for dance command: unrecognized. Valid options '
'are: example, help, integer, no_color, opt_3, option3, '
'pythonpath, settings, skip_checks, stderr, stdout, style, '
'traceback, verbosity, version.'
'are: example, force_color, help, integer, no_color, opt_3, '
'option3, pythonpath, settings, skip_checks, stderr, stdout, '
'style, traceback, verbosity, version.'
)
with self.assertRaisesMessage(TypeError, msg):
management.call_command('dance', unrecognized=1)
msg = (
'Unknown option(s) for dance command: unrecognized, unrecognized2. '
'Valid options are: example, help, integer, no_color, opt_3, '
'option3, pythonpath, settings, skip_checks, stderr, stdout, '
'style, traceback, verbosity, version.'
'Valid options are: example, force_color, help, integer, no_color, '
'opt_3, option3, pythonpath, settings, skip_checks, stderr, '
'stdout, style, traceback, verbosity, version.'
)
with self.assertRaisesMessage(TypeError, msg):
management.call_command('dance', unrecognized=1, unrecognized2=1)