mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #34691 -- Added system check for unmatched angle brackets in path().
This commit is contained in:
committed by
Mariusz Felisiak
parent
2ddfa3e2b6
commit
d1855c4847
@@ -161,6 +161,47 @@ class CheckUrlConfigTests(SimpleTestCase):
|
||||
],
|
||||
)
|
||||
|
||||
@override_settings(
|
||||
ROOT_URLCONF="check_framework.urls.path_compatibility.matched_angle_brackets"
|
||||
)
|
||||
def test_no_warnings_matched_angle_brackets(self):
|
||||
self.assertEqual(check_url_config(None), [])
|
||||
|
||||
@override_settings(
|
||||
ROOT_URLCONF="check_framework.urls.path_compatibility.unmatched_angle_brackets"
|
||||
)
|
||||
def test_warning_unmatched_angle_brackets(self):
|
||||
self.assertEqual(
|
||||
check_url_config(None),
|
||||
[
|
||||
Warning(
|
||||
"Your URL pattern 'beginning-with/<angle_bracket' has an unmatched "
|
||||
"'<' bracket.",
|
||||
id="urls.W010",
|
||||
),
|
||||
Warning(
|
||||
"Your URL pattern 'ending-with/angle_bracket>' has an unmatched "
|
||||
"'>' bracket.",
|
||||
id="urls.W010",
|
||||
),
|
||||
Warning(
|
||||
"Your URL pattern 'closed_angle>/x/<opened_angle' has an unmatched "
|
||||
"'>' bracket.",
|
||||
id="urls.W010",
|
||||
),
|
||||
Warning(
|
||||
"Your URL pattern 'closed_angle>/x/<opened_angle' has an unmatched "
|
||||
"'<' bracket.",
|
||||
id="urls.W010",
|
||||
),
|
||||
Warning(
|
||||
"Your URL pattern '<mixed>angle_bracket>' has an unmatched '>' "
|
||||
"bracket.",
|
||||
id="urls.W010",
|
||||
),
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
class UpdatedToPathTests(SimpleTestCase):
|
||||
@override_settings(
|
||||
|
||||
Reference in New Issue
Block a user