summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_module_loading.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-02-26 22:48:20 +0100
committerClaude Paroz <claude@2xlibre.net>2014-03-08 09:57:40 +0100
commit210d0489c5daad56b806f8165f9fe09fb3c2a019 (patch)
treef16c665e94669288fec0c3712a5639e9ad1ad1a7 /tests/utils_tests/test_module_loading.py
parent70ec4d776ef0e68960ccee21476b8654e9399f53 (diff)
Fixed #21188 -- Introduced subclasses for to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the review.
Diffstat (limited to 'tests/utils_tests/test_module_loading.py')
-rw-r--r--tests/utils_tests/test_module_loading.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/utils_tests/test_module_loading.py b/tests/utils_tests/test_module_loading.py
index 2eb01ad770..48ba9c15ff 100644
--- a/tests/utils_tests/test_module_loading.py
+++ b/tests/utils_tests/test_module_loading.py
@@ -10,6 +10,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, modify_settings
from django.test.utils import IgnorePendingDeprecationWarningsMixin, extend_sys_path
from django.utils import six
+from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.module_loading import (autodiscover_modules, import_by_path, import_string,
module_has_submodule)
from django.utils._os import upath
@@ -134,11 +135,11 @@ class ModuleImportTestCase(IgnorePendingDeprecationWarningsMixin, unittest.TestC
def test_import_by_path_pending_deprecation_warning(self):
with warnings.catch_warnings(record=True) as w:
- warnings.simplefilter('always', category=PendingDeprecationWarning)
+ warnings.simplefilter('always', category=RemovedInDjango19Warning)
cls = import_by_path('django.utils.module_loading.import_by_path')
self.assertEqual(cls, import_by_path)
self.assertEqual(len(w), 1)
- self.assertTrue(issubclass(w[-1].category, PendingDeprecationWarning))
+ self.assertTrue(issubclass(w[-1].category, RemovedInDjango19Warning))
self.assertIn('deprecated', str(w[-1].message))
def test_import_string(self):