diff options
author | Tim Graham <timograham@gmail.com> | 2015-08-18 12:07:13 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:09 -0400 |
commit | 1392aff440bc8be26ac09062265269a0414d96d1 (patch) | |
tree | 7907ec2fc18b98bd1adde099c7ac2dbe7ae9c7b5 /tests/deprecation | |
parent | 5c62887d82b1d886c97eb2d4ed3f596b0e6bfebb (diff) | |
download | django-1392aff440bc8be26ac09062265269a0414d96d1.tar.gz |
Refs #21977 -- Removed SimpleTestCase.urls per deprecation timeline.
Diffstat (limited to 'tests/deprecation')
-rw-r--r-- | tests/deprecation/tests.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/deprecation/tests.py b/tests/deprecation/tests.py index 8f4ccf4eb5..e1ff2c8d2c 100644 --- a/tests/deprecation/tests.py +++ b/tests/deprecation/tests.py @@ -1,14 +1,11 @@ from __future__ import unicode_literals -import os -import unittest import warnings from django.test import SimpleTestCase from django.test.utils import reset_warning_registry from django.utils import six from django.utils.deprecation import RenameMethodsBase -from django.utils.encoding import force_text class RenameManagerMethods(RenameMethodsBase): @@ -173,27 +170,3 @@ class RenameMethodsTests(SimpleTestCase): '`DeprecatedMixin.old` is deprecated, use `new` instead.', '`RenamedMixin.old` is deprecated, use `new` instead.', ]) - - -class DeprecatingSimpleTestCaseUrls(unittest.TestCase): - - def test_deprecation(self): - """ - Ensure the correct warning is raised when SimpleTestCase.urls is used. - """ - class TempTestCase(SimpleTestCase): - urls = 'tests.urls' - - def test(self): - pass - - with warnings.catch_warnings(record=True) as recorded: - warnings.filterwarnings('always') - suite = unittest.TestLoader().loadTestsFromTestCase(TempTestCase) - with open(os.devnull, 'w') as devnull: - unittest.TextTestRunner(stream=devnull, verbosity=2).run(suite) - msg = force_text(recorded.pop().message) - self.assertEqual(msg, - "SimpleTestCase.urls is deprecated and will be removed in " - "Django 1.10. Use @override_settings(ROOT_URLCONF=...) " - "in TempTestCase instead.") |