diff options
Diffstat (limited to 'tests/admin_docs/test_views.py')
| -rw-r--r-- | tests/admin_docs/test_views.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/admin_docs/test_views.py b/tests/admin_docs/test_views.py index b9955717f4..a64da843ed 100644 --- a/tests/admin_docs/test_views.py +++ b/tests/admin_docs/test_views.py @@ -293,6 +293,16 @@ class TestModelDetailView(TestDataMixin, AdminDocsTestCase): def test_model_detail_title(self): self.assertContains(self.response, '<h1>admin_docs.Person</h1>', html=True) + def test_app_not_found(self): + response = self.client.get(reverse('django-admindocs-models-detail', args=['doesnotexist', 'Person'])) + self.assertEqual(response.context['exception'], "App 'doesnotexist' not found") + self.assertEqual(response.status_code, 404) + + def test_model_not_found(self): + response = self.client.get(reverse('django-admindocs-models-detail', args=['admin_docs', 'doesnotexist'])) + self.assertEqual(response.context['exception'], "Model 'doesnotexist' not found in app 'admin_docs'") + self.assertEqual(response.status_code, 404) + class CustomField(models.Field): description = "A custom field type" |
