diff options
| author | Andrew Nester <andrew.nester.dev@gmail.com> | 2016-12-22 00:54:15 +0300 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-21 16:54:15 -0500 |
| commit | 24fa728a476a6da3e565dbe33959ea62c02c250b (patch) | |
| tree | bc60bd30f9426d267533c9b5d024858e97dc6d84 /tests/check_framework/urls | |
| parent | 3188b49ee29bb8c7183b55bda784e642a6ec3011 (diff) | |
Fixed #27612 -- Added a check for duplicate URL instance namespaces.
Diffstat (limited to 'tests/check_framework/urls')
| -rw-r--r-- | tests/check_framework/urls/non_unique_namespaces.py | 13 | ||||
| -rw-r--r-- | tests/check_framework/urls/unique_namespaces.py | 11 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/check_framework/urls/non_unique_namespaces.py b/tests/check_framework/urls/non_unique_namespaces.py new file mode 100644 index 0000000000..781be4c6d0 --- /dev/null +++ b/tests/check_framework/urls/non_unique_namespaces.py @@ -0,0 +1,13 @@ +from django.conf.urls import include, url + +common_url_patterns = ([ + url(r'^app-ns1/', include([])), + url(r'^app-url/', include([])), +], 'app-ns1') + +urlpatterns = [ + url(r'^app-ns1-0/', include(common_url_patterns)), + url(r'^app-ns1-1/', include(common_url_patterns)), + url(r'^app-some-url/', include(([], 'app'), namespace='app-1')), + url(r'^app-some-url-2/', include(([], 'app'), namespace='app-1')) +] diff --git a/tests/check_framework/urls/unique_namespaces.py b/tests/check_framework/urls/unique_namespaces.py new file mode 100644 index 0000000000..897f27757e --- /dev/null +++ b/tests/check_framework/urls/unique_namespaces.py @@ -0,0 +1,11 @@ +from django.conf.urls import include, url + +common_url_patterns = ([ + url(r'^app-ns1/', include([])), + url(r'^app-url/', include([])), +], 'common') + +urlpatterns = [ + url(r'^app-ns1-0/', include(common_url_patterns, namespace='app-include-1')), + url(r'^app-ns1-1/', include(common_url_patterns, namespace='app-include-2')) +] |
