From f0ef0c49e9284f262fbc63e8a497699ca4a248fe Mon Sep 17 00:00:00 2001 From: Ketan Bhatt Date: Mon, 30 May 2016 20:44:00 +0530 Subject: Fixed #26621 -- Corrected simplify_regex()'s handling of named capture groups. --- tests/admin_docs/test_views.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/admin_docs/test_views.py b/tests/admin_docs/test_views.py index a5134d7627..b48147fc85 100644 --- a/tests/admin_docs/test_views.py +++ b/tests/admin_docs/test_views.py @@ -335,6 +335,11 @@ class AdminDocViewFunctionsTests(SimpleTestCase): (r'^a', '/a'), (r'^(?P\w+)/b/(?P\w+)/$', '//b//'), (r'^(?P\w+)/b/(?P\w+)$', '//b/'), + (r'^(?P\w+)/b/(\w+)$', '//b/'), + (r'^(?P\w+)/b/((x|y)\w+)$', '//b/'), + (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'), ) for pattern, output in tests: self.assertEqual(simplify_regex(pattern), output) -- cgit v1.3