diff options
| author | Ville Skyttä <ville.skytta@iki.fi> | 2016-06-14 16:03:12 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-06-14 09:03:12 -0400 |
| commit | fa654da6130df80239e181c432595442e688ee8b (patch) | |
| tree | dfd49d910bc2f41b1c33a86384dd07a34efbf5f4 | |
| parent | 7003174fec188bd5a21e3d62bd5e13e80f6f329c (diff) | |
Removed usage of a few deprecated unittest assertions.
| -rw-r--r-- | tests/check_framework/test_urls.py | 3 | ||||
| -rw-r--r-- | tests/utils_tests/test_functional.py | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/tests/check_framework/test_urls.py b/tests/check_framework/test_urls.py index a1ac727057..786d040493 100644 --- a/tests/check_framework/test_urls.py +++ b/tests/check_framework/test_urls.py @@ -4,6 +4,7 @@ from django.core.checks.urls import ( ) from django.test import SimpleTestCase from django.test.utils import override_settings +from django.utils import six class CheckUrlsTest(SimpleTestCase): @@ -34,7 +35,7 @@ class CheckUrlsTest(SimpleTestCase): result = check_url_config(None) warning = result[0] self.assertEqual(warning.id, 'urls.E004') - self.assertRegexpMatches(warning.msg, ( + six.assertRegex(self, warning.msg, ( r"^Your URL pattern \('\^tuple/\$', <function <lambda> at 0x(\w+)>\) is " r"invalid. Ensure that urlpatterns is a list of url\(\) instances.$" )) diff --git a/tests/utils_tests/test_functional.py b/tests/utils_tests/test_functional.py index 2cf399f892..f62784f1b0 100644 --- a/tests/utils_tests/test_functional.py +++ b/tests/utils_tests/test_functional.py @@ -134,14 +134,14 @@ class FunctionalTestCase(unittest.TestCase): def test_lazy_repr_text(self): original_object = 'Lazy translation text' lazy_obj = lazy(lambda: original_object, six.text_type) - self.assertEquals(repr(original_object), repr(lazy_obj())) + self.assertEqual(repr(original_object), repr(lazy_obj())) def test_lazy_repr_int(self): original_object = 15 lazy_obj = lazy(lambda: original_object, int) - self.assertEquals(repr(original_object), repr(lazy_obj())) + self.assertEqual(repr(original_object), repr(lazy_obj())) def test_lazy_repr_bytes(self): original_object = b'J\xc3\xbcst a str\xc3\xadng' lazy_obj = lazy(lambda: original_object, bytes) - self.assertEquals(repr(original_object), repr(lazy_obj())) + self.assertEqual(repr(original_object), repr(lazy_obj())) |
