mirror of
https://github.com/django/django.git
synced 2025-01-10 10:26:34 +00:00
[1.10.x] Removed usage of a deprecated unittest assertion.
Backport of fa654da613
from master
This commit is contained in:
parent
61bcf04132
commit
84737135f6
@ -4,6 +4,7 @@ from django.core.checks.urls import (
|
|||||||
)
|
)
|
||||||
from django.test import SimpleTestCase
|
from django.test import SimpleTestCase
|
||||||
from django.test.utils import override_settings
|
from django.test.utils import override_settings
|
||||||
|
from django.utils import six
|
||||||
|
|
||||||
|
|
||||||
class CheckUrlsTest(SimpleTestCase):
|
class CheckUrlsTest(SimpleTestCase):
|
||||||
@ -34,7 +35,7 @@ class CheckUrlsTest(SimpleTestCase):
|
|||||||
result = check_url_config(None)
|
result = check_url_config(None)
|
||||||
warning = result[0]
|
warning = result[0]
|
||||||
self.assertEqual(warning.id, 'urls.E004')
|
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"^Your URL pattern \('\^tuple/\$', <function <lambda> at 0x(\w+)>\) is "
|
||||||
r"invalid. Ensure that urlpatterns is a list of url\(\) instances.$"
|
r"invalid. Ensure that urlpatterns is a list of url\(\) instances.$"
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user