diff options
| author | Tim Graham <timograham@gmail.com> | 2016-06-23 12:04:05 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-23 12:04:05 -0400 |
| commit | 81cdcb66bc74a0768d13f0e18872d46739028e64 (patch) | |
| tree | a7b0c5577f17242f992ebc308acfccc738635d0a /tests/admin_scripts | |
| parent | b5a1c3a6f50362b57603e1833e44bff5628dde3c (diff) | |
Fixed #26791 -- Replaced LiveServerTestCase port ranges with binding to port 0.
Diffstat (limited to 'tests/admin_scripts')
| -rw-r--r-- | tests/admin_scripts/tests.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index fd7b7869ba..1376ea9203 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -28,7 +28,6 @@ from django.db.migrations.recorder import MigrationRecorder from django.test import ( LiveServerTestCase, SimpleTestCase, TestCase, mock, override_settings, ) -from django.test.runner import DiscoverRunner from django.utils._os import npath, upath from django.utils.encoding import force_text from django.utils.six import PY2, PY3, StringIO @@ -1276,46 +1275,6 @@ class ManageCheck(AdminScriptTestCase): self.assertNoOutput(out) -class CustomTestRunner(DiscoverRunner): - - def __init__(self, *args, **kwargs): - assert 'liveserver' not in kwargs - super(CustomTestRunner, self).__init__(*args, **kwargs) - - def run_tests(self, test_labels, extra_tests=None, **kwargs): - pass - - -class ManageTestCommand(AdminScriptTestCase): - def test_liveserver(self): - """ - Ensure that the --liveserver option sets the environment variable - correctly. - Refs #2879. - """ - - # Backup original state - address_predefined = 'DJANGO_LIVE_TEST_SERVER_ADDRESS' in os.environ - old_address = os.environ.get('DJANGO_LIVE_TEST_SERVER_ADDRESS') - - 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) - - 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') - - # Restore original state - if address_predefined: - os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] = old_address - else: - del os.environ['DJANGO_LIVE_TEST_SERVER_ADDRESS'] - - class ManageRunserver(AdminScriptTestCase): def setUp(self): from django.core.management.commands.runserver import Command |
