1
0
mirror of https://github.com/django/django.git synced 2024-12-30 13:05:45 +00:00
django/tests/urlpatterns_reverse/named_urls_conflict.py
Robert Roskam 98bcc5d81b Fixed #27367 -- Doc'd and tested reversing of URLs with the same name.
Thanks Reinout van Rees for contributing to the patch.
2017-02-11 08:58:40 -05:00

18 lines
792 B
Python

from django.conf.urls import url
from .views import empty_view
urlpatterns = [
# No kwargs
url(r'^conflict/cannot-go-here/$', empty_view, name='name-conflict'),
url(r'^conflict/$', empty_view, name='name-conflict'),
# One kwarg
url(r'^conflict-first/(?P<first>\w+)/$', empty_view, name='name-conflict'),
url(r'^conflict-cannot-go-here/(?P<middle>\w+)/$', empty_view, name='name-conflict'),
url(r'^conflict-middle/(?P<middle>\w+)/$', empty_view, name='name-conflict'),
url(r'^conflict-last/(?P<last>\w+)/$', empty_view, name='name-conflict'),
# Two kwargs
url(r'^conflict/(?P<another>\w+)/(?P<extra>\w+)/cannot-go-here/$', empty_view, name='name-conflict'),
url(r'^conflict/(?P<extra>\w+)/(?P<another>\w+)/$', empty_view, name='name-conflict'),
]