diff options
| author | Ketan Bhatt <ketanbhatt1006@gmail.com> | 2016-05-30 20:44:00 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-03 13:55:11 -0500 |
| commit | f0ef0c49e9284f262fbc63e8a497699ca4a248fe (patch) | |
| tree | c416dc190d4840d3e6c80b6404baa9f23bd1d2d2 /tests/admin_docs | |
| parent | fd2f7e47671239dcff98cfb922221ab170aa6461 (diff) | |
Fixed #26621 -- Corrected simplify_regex()'s handling of named capture groups.
Diffstat (limited to 'tests/admin_docs')
| -rw-r--r-- | tests/admin_docs/test_views.py | 5 |
1 files changed, 5 insertions, 0 deletions
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<a>\w+)/b/(?P<c>\w+)/$', '/<a>/b/<c>/'), (r'^(?P<a>\w+)/b/(?P<c>\w+)$', '/<a>/b/<c>'), + (r'^(?P<a>\w+)/b/(\w+)$', '/<a>/b/<var>'), + (r'^(?P<a>\w+)/b/((x|y)\w+)$', '/<a>/b/<var>'), + (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'), ) for pattern, output in tests: self.assertEqual(simplify_regex(pattern), output) |
