diff options
Diffstat (limited to 'tests/admin_scripts/tests.py')
| -rw-r--r-- | tests/admin_scripts/tests.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 8f2ba6cab1..8a65b136c2 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -1269,10 +1269,6 @@ class CustomTestRunner(DiscoverRunner): class ManageTestCommand(AdminScriptTestCase): - def setUp(self): - from django.core.management.commands.test import Command as TestCommand - self.cmd = TestCommand() - def test_liveserver(self): """ Ensure that the --liveserver option sets the environment variable @@ -1284,14 +1280,13 @@ class ManageTestCommand(AdminScriptTestCase): address_predefined = 'DJANGO_LIVE_TEST_SERVER_ADDRESS' in os.environ old_address = os.environ.get('DJANGO_LIVE_TEST_SERVER_ADDRESS') - self.cmd.handle(verbosity=0, testrunner='admin_scripts.tests.CustomTestRunner') + call_command('test', verbosity=0, testrunner='admin_scripts.tests.CustomTestRunner') # Original state hasn't changed self.assertEqual('DJANGO_LIVE_TEST_SERVER_ADDRESS' in os.environ, address_predefined) self.assertEqual(os.environ.get('DJANGO_LIVE_TEST_SERVER_ADDRESS'), old_address) - self.cmd.handle(verbosity=0, testrunner='admin_scripts.tests.CustomTestRunner', - liveserver='blah') + call_command('test', verbosity=0, testrunner='admin_scripts.tests.CustomTestRunner', liveserver='blah') # Variable was correctly set self.assertEqual(os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'], 'blah') |
