mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #28135 -- Made simplify_regex() handle non-capturing groups.
This commit is contained in:
committed by
Mariusz Felisiak
parent
fdfa97fb16
commit
0a17666045
@@ -397,6 +397,13 @@ class AdminDocViewFunctionsTests(SimpleTestCase):
|
||||
(r'^(?P<a>(x|y))/b/(?P<c>\w+)', '/<a>/b/<c>'),
|
||||
(r'^(?P<a>(x|y))/b/(?P<c>\w+)ab', '/<a>/b/<c>ab'),
|
||||
(r'^(?P<a>(x|y)(\(|\)))/b/(?P<c>\w+)ab', '/<a>/b/<c>ab'),
|
||||
# Non-capturing groups.
|
||||
(r'^a(?:\w+)b', '/ab'),
|
||||
(r'^a(?:(x|y))', '/a'),
|
||||
(r'^(?:\w+(?:\w+))a', '/a'),
|
||||
(r'^a(?:\w+)/b(?:\w+)', '/a/b'),
|
||||
(r'(?P<a>\w+)/b/(?:\w+)c(?:\w+)', '/<a>/b/c'),
|
||||
(r'(?P<a>\w+)/b/(\w+)/(?:\w+)c(?:\w+)', '/<a>/b/<var>/c'),
|
||||
# Single and repeated metacharacters.
|
||||
(r'^a', '/a'),
|
||||
(r'^^a', '/a'),
|
||||
|
||||
Reference in New Issue
Block a user