diff --git a/tests/admin_docs/test_views.py b/tests/admin_docs/test_views.py index 085b821a37..73426a3f8f 100644 --- a/tests/admin_docs/test_views.py +++ b/tests/admin_docs/test_views.py @@ -385,7 +385,7 @@ class AdminDocViewFunctionsTests(SimpleTestCase): def test_simplify_regex(self): tests = ( - (r'^a', '/a'), + # Named and unnamed groups. (r'^(?P\w+)/b/(?P\w+)/$', '//b//'), (r'^(?P\w+)/b/(?P\w+)$', '//b/'), (r'^(?P\w+)/b/(?P\w+)', '//b/'), @@ -397,6 +397,17 @@ class AdminDocViewFunctionsTests(SimpleTestCase): (r'^(?P(x|y))/b/(?P\w+)', '//b/'), (r'^(?P(x|y))/b/(?P\w+)ab', '//b/ab'), (r'^(?P(x|y)(\(|\)))/b/(?P\w+)ab', '//b/ab'), + # Single and repeated metacharacters. + (r'^a', '/a'), + (r'^^a', '/a'), + (r'^^^a', '/a'), + (r'a$', '/a'), + (r'a$$', '/a'), + (r'a$$$', '/a'), + (r'a?', '/a'), + (r'a??', '/a'), + (r'a???', '/a'), + # Multiple mixed metacharacters. (r'^a/?$', '/a/'), ) for pattern, output in tests: