|
@@ -799,7 +799,9 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
|
|
|
reverse("admin:admin_views_complexsortedperson_changelist"), {}
|
|
|
)
|
|
|
|
|
|
- self.assertContains(response, '<th scope="col"', count=5)
|
|
|
+ result_list_table_re = re.compile('<table id="result_list">(.*?)</thead>')
|
|
|
+ result_list_table_head = result_list_table_re.search(str(response.content))[0]
|
|
|
+ self.assertEqual(result_list_table_head.count('<th scope="col"'), 5)
|
|
|
|
|
|
self.assertContains(response, "Name")
|
|
|
self.assertContains(response, "Colored name")
|
|
@@ -830,7 +832,11 @@ class AdminViewBasicTest(AdminViewBasicTestCase):
|
|
|
reverse("admin:admin_views_%s_changelist" % url), {}
|
|
|
)
|
|
|
|
|
|
- self.assertContains(response, '<th scope="col"', count=3, msg_prefix=url)
|
|
|
+ result_list_table_re = re.compile('<table id="result_list">(.*?)</thead>')
|
|
|
+ result_list_table_head = result_list_table_re.search(str(response.content))[
|
|
|
+ 0
|
|
|
+ ]
|
|
|
+ self.assertEqual(result_list_table_head.count('<th scope="col"'), 3)
|
|
|
|
|
|
|
|
|
|
|
@@ -7498,12 +7504,26 @@ class CSSTest(TestCase):
|
|
|
|
|
|
response = self.client.get(reverse("admin:index"))
|
|
|
self.assertContains(response, '<div class="app-admin_views module')
|
|
|
+ self.assertContains(
|
|
|
+ response,
|
|
|
+ '<thead class="visually-hidden"><tr><th scope="col">Model name</th>'
|
|
|
+ '<th scope="col">Add link</th><th scope="col">Change or view list link</th>'
|
|
|
+ "</tr></thead>",
|
|
|
+ html=True,
|
|
|
+ )
|
|
|
self.assertContains(response, '<tr class="model-actor">')
|
|
|
self.assertContains(response, '<tr class="model-album">')
|
|
|
|
|
|
|
|
|
response = self.client.get(reverse("admin:app_list", args=("admin_views",)))
|
|
|
self.assertContains(response, '<div class="app-admin_views module')
|
|
|
+ self.assertContains(
|
|
|
+ response,
|
|
|
+ '<thead class="visually-hidden"><tr><th scope="col">Model name</th>'
|
|
|
+ '<th scope="col">Add link</th><th scope="col">Change or view list link</th>'
|
|
|
+ "</tr></thead>",
|
|
|
+ html=True,
|
|
|
+ )
|
|
|
self.assertContains(response, '<tr class="model-actor">')
|
|
|
self.assertContains(response, '<tr class="model-album">')
|
|
|
|