Completed test coverage for ModelDetailView.
This commit is contained in:
parent
e2908ecb3e
commit
a613feb5d3
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue