mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #23813 -- Moved URLconfs into module and tidied docstrings.
This commit is contained in:
committed by
Tim Graham
parent
392f64842f
commit
f2975c021d
@@ -4,12 +4,12 @@ from django.test.utils import override_settings
|
||||
|
||||
|
||||
class CheckUrlsTest(SimpleTestCase):
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls_no_warnings')
|
||||
def test_include_no_warnings(self):
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls.no_warnings')
|
||||
def test_no_warnings(self):
|
||||
result = check_url_config(None)
|
||||
self.assertEqual(result, [])
|
||||
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls_include')
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls.include_with_dollar')
|
||||
def test_include_with_dollar(self):
|
||||
result = check_url_config(None)
|
||||
self.assertEqual(len(result), 1)
|
||||
@@ -18,8 +18,8 @@ class CheckUrlsTest(SimpleTestCase):
|
||||
expected_msg = "Your URL pattern '^include-with-dollar$' uses include with a regex ending with a '$'."
|
||||
self.assertIn(expected_msg, warning.msg)
|
||||
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls_slash')
|
||||
def test_url_beginning_with_slash(self):
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls.beginning_with_slash')
|
||||
def test_beginning_with_slash(self):
|
||||
result = check_url_config(None)
|
||||
self.assertEqual(len(result), 1)
|
||||
warning = result[0]
|
||||
@@ -27,8 +27,8 @@ class CheckUrlsTest(SimpleTestCase):
|
||||
expected_msg = "Your URL pattern '/starting-with-slash/$' has a regex beginning with a '/'"
|
||||
self.assertIn(expected_msg, warning.msg)
|
||||
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls_name')
|
||||
def test_url_pattern_name_with_colon(self):
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls.name_with_colon')
|
||||
def test_name_with_colon(self):
|
||||
result = check_url_config(None)
|
||||
self.assertEqual(len(result), 1)
|
||||
warning = result[0]
|
||||
|
||||
Reference in New Issue
Block a user