summaryrefslogtreecommitdiff
path: root/tests/admin_docs
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2016-06-18 16:39:32 +0200
committerTim Graham <timograham@gmail.com>2016-06-18 10:39:32 -0400
commit625b8e9295d79650208bfb3fca8bf9e6aaf578e4 (patch)
tree232d35a11093b840a5dd6badbbc0fe1bb4f933ba /tests/admin_docs
parent26d0023cccd08473b0acc90e6f06bf3e93ebd847 (diff)
Fixed #24931 -- Made namespaced RegexURLResolvers populate callback strings.
Fixed a regression in 2f16ff5a6cbd71fc6c50e88e4087f3657222e90e. Thanks Tim Graham for the review.
Diffstat (limited to 'tests/admin_docs')
-rw-r--r--tests/admin_docs/namespace_urls.py14
-rw-r--r--tests/admin_docs/tests.py6
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/admin_docs/namespace_urls.py b/tests/admin_docs/namespace_urls.py
new file mode 100644
index 0000000000..d05922c33e
--- /dev/null
+++ b/tests/admin_docs/namespace_urls.py
@@ -0,0 +1,14 @@
+from django.conf.urls import include, url
+from django.contrib import admin
+
+from . import views
+
+backend_urls = ([
+ url(r'^something/$', views.XViewClass.as_view(), name='something'),
+], 'backend')
+
+urlpatterns = [
+ url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
+ url(r'^admin/', admin.site.urls),
+ url(r'^api/backend/', include(backend_urls, namespace='backend')),
+]
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py
index 3d5955d680..82384a4bb8 100644
--- a/tests/admin_docs/tests.py
+++ b/tests/admin_docs/tests.py
@@ -88,6 +88,12 @@ class AdminDocViewTests(TestDataMixin, AdminDocsTestCase):
# View docstring
self.assertContains(response, 'Base view for admindocs views.')
+ @override_settings(ROOT_URLCONF='admin_docs.namespace_urls')
+ def test_namespaced_view_detail(self):
+ url = reverse('django-admindocs-views-detail', args=['admin_docs.views.XViewClass'])
+ response = self.client.get(url)
+ self.assertContains(response, '<h1>admin_docs.views.XViewClass</h1>')
+
def test_view_detail_illegal_import(self):
"""
#23601 - Ensure the view exists in the URLconf.