Made sure `manage.py help test` works.
Thanks shige DOT abe AT nasa DOT gov for the report. Fixes #17477. Refs r16352. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17284 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
a343a84ce6
commit
953a471a21
|
@ -31,13 +31,16 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
requires_model_validation = False
|
requires_model_validation = False
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.test_runner = None
|
||||||
|
super(Command, self).__init__()
|
||||||
|
|
||||||
def run_from_argv(self, argv):
|
def run_from_argv(self, argv):
|
||||||
"""
|
"""
|
||||||
Pre-parse the command line to extract the value of the --testrunner
|
Pre-parse the command line to extract the value of the --testrunner
|
||||||
option. This allows a test runner to define additional command line
|
option. This allows a test runner to define additional command line
|
||||||
arguments.
|
arguments.
|
||||||
"""
|
"""
|
||||||
self.test_runner = None
|
|
||||||
option = '--testrunner='
|
option = '--testrunner='
|
||||||
for arg in argv[2:]:
|
for arg in argv[2:]:
|
||||||
if arg.startswith(option):
|
if arg.startswith(option):
|
||||||
|
|
|
@ -214,6 +214,20 @@ class CustomTestRunnerOptionsTests(AdminScriptTestCase):
|
||||||
self.assertOutput(out, 'bar:foo:31337')
|
self.assertOutput(out, 'bar:foo:31337')
|
||||||
|
|
||||||
|
|
||||||
|
class Ticket17477RegressionTests(AdminScriptTestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.write_settings('settings.py')
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
self.remove_settings('settings.py')
|
||||||
|
|
||||||
|
def test_ticket_17477(self):
|
||||||
|
"""'manage.py help test' works after r16352."""
|
||||||
|
args = ['help', 'test']
|
||||||
|
out, err = self.run_manage(args)
|
||||||
|
self.assertNoOutput(err)
|
||||||
|
|
||||||
|
|
||||||
class ModulesTestsPackages(unittest.TestCase):
|
class ModulesTestsPackages(unittest.TestCase):
|
||||||
def test_get_tests(self):
|
def test_get_tests(self):
|
||||||
"Check that the get_tests helper function can find tests in a directory"
|
"Check that the get_tests helper function can find tests in a directory"
|
||||||
|
|
Loading…
Reference in New Issue