mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Clarified URL regex check message with respect to include().
This commit is contained in:
committed by
Tim Graham
parent
6b54504e66
commit
7ed8b98f42
@@ -46,7 +46,13 @@ class CheckUrlsTest(SimpleTestCase):
|
||||
self.assertEqual(len(result), 1)
|
||||
warning = result[0]
|
||||
self.assertEqual(warning.id, 'urls.W002')
|
||||
expected_msg = "Your URL pattern '/starting-with-slash/$' has a regex beginning with a '/'"
|
||||
expected_msg = (
|
||||
"Your URL pattern '/starting-with-slash/$' has a regex beginning "
|
||||
"with a '/'. Remove this slash as it is unnecessary. If this "
|
||||
"pattern is targeted in an include(), ensure the include() pattern "
|
||||
"has a trailing '/'."
|
||||
)
|
||||
|
||||
self.assertIn(expected_msg, warning.msg)
|
||||
|
||||
@override_settings(ROOT_URLCONF='check_framework.urls.name_with_colon')
|
||||
|
||||
Reference in New Issue
Block a user