diff options
| author | Markus Holtermann <info@markusholtermann.eu> | 2014-10-04 19:04:21 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-10-06 09:31:39 -0400 |
| commit | 2f16ff5a6cbd71fc6c50e88e4087f3657222e90e (patch) | |
| tree | b407362fde4e16ee4ea53ce4346e13bd4fd2ed23 /tests/admin_docs | |
| parent | a24cf217220dca44b7bd5b36ad9c14a96bca486e (diff) | |
Fixed #23601 -- Ensured view exists in URLconf before importing it in admindocs.
Diffstat (limited to 'tests/admin_docs')
| -rw-r--r-- | tests/admin_docs/tests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/admin_docs/tests.py b/tests/admin_docs/tests.py index 0826dfc973..c410eff020 100644 --- a/tests/admin_docs/tests.py +++ b/tests/admin_docs/tests.py @@ -1,3 +1,4 @@ +import sys import unittest from django.conf import settings @@ -84,6 +85,16 @@ class AdminDocViewTests(AdminDocsTestCase): # View docstring self.assertContains(response, 'Base view for admindocs views.') + def test_view_detail_illegal_import(self): + """ + #23601 - Ensure the view exists in the URLconf. + """ + response = self.client.get( + reverse('django-admindocs-views-detail', + args=['urlpatterns_reverse.nonimported_module.view'])) + self.assertEqual(response.status_code, 404) + self.assertNotIn("urlpatterns_reverse.nonimported_module", sys.modules) + def test_model_index(self): response = self.client.get(reverse('django-admindocs-models-index')) self.assertContains( |
