Refs #32034 -- Added test for title on admin app index view.

This commit is contained in:
Raffaele Salmaso 2020-09-23 09:42:13 +02:00 committed by Mariusz Felisiak
parent 71d10ca8c9
commit 666f2e8acd
1 changed files with 9 additions and 0 deletions

View File

@ -1033,6 +1033,15 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
self.assertContains(response, '<th scope="col" class="column-value">') self.assertContains(response, '<th scope="col" class="column-value">')
self.assertNotContains(response, '<th scope="col" class="sortable column') self.assertNotContains(response, '<th scope="col" class="sortable column')
def test_app_index_context(self):
response = self.client.get(reverse('admin:app_list', args=('admin_views',)))
self.assertContains(
response,
'<title>Admin_Views administration | Django site admin</title>',
)
self.assertEqual(response.context['title'], 'Admin_Views administration')
self.assertEqual(response.context['app_label'], 'admin_views')
def test_change_view_subtitle_per_object(self): def test_change_view_subtitle_per_object(self):
response = self.client.get( response = self.client.get(
reverse('admin:admin_views_article_change', args=(self.a1.pk,)), reverse('admin:admin_views_article_change', args=(self.a1.pk,)),