1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #24904 -- Fixed nested namespaces in current_app.

Fixed reverse() to correctly handled nested namespace lookups
in current_app.
This commit is contained in:
Marten Kenbeek
2015-06-03 17:11:08 +02:00
committed by Tim Graham
parent 6b41834855
commit f0450c9b12
3 changed files with 61 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ from .namespace_urls import URLObject
from .views import view_class_instance
testobj3 = URLObject('testapp', 'test-ns3')
testobj4 = URLObject('testapp', 'test-ns4')
# test deprecated patterns() function. convert to list of urls() in Django 2.0
with warnings.catch_warnings():
@@ -24,6 +25,7 @@ with warnings.catch_warnings():
url(r'^view_class/(?P<arg1>[0-9]+)/(?P<arg2>[0-9]+)/$', view_class_instance, name='inc-view-class'),
(r'^test3/', include(testobj3.urls)),
(r'^test4/', include(testobj4.urls)),
(r'^ns-included3/', include('urlpatterns_reverse.included_urls', namespace='inc-ns3')),
(r'^ns-included4/', include('urlpatterns_reverse.namespace_urls', namespace='inc-ns4')),
)