kopia lustrzana https://github.com/wagtail/wagtail
Ensure that tests checking for th/td scope the checks to specific tables
rodzic
049e7dad54
commit
269a0e4d90
|
@ -994,7 +994,7 @@ class TestHistoryView(WagtailTestUtils, TestCase):
|
|||
)
|
||||
response = self.client.get(self.url)
|
||||
soup = self.get_soup(response.content)
|
||||
rows = soup.select("tbody tr")
|
||||
rows = soup.select("#listing-results tbody tr")
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(len(rows), 2)
|
||||
|
||||
|
@ -1084,7 +1084,7 @@ class TestUsageView(WagtailTestUtils, TestCase):
|
|||
h1 = soup.select_one("h1")
|
||||
self.assertEqual(h1.text.strip(), f"Usage: {self.object}")
|
||||
|
||||
tds = soup.select("tbody tr td")
|
||||
tds = soup.select("#listing-results tbody tr td")
|
||||
self.assertEqual(len(tds), 3)
|
||||
self.assertEqual(tds[0].text.strip(), str(self.tbx))
|
||||
self.assertEqual(tds[1].text.strip(), "Various on delete model")
|
||||
|
@ -1132,7 +1132,7 @@ class TestUsageView(WagtailTestUtils, TestCase):
|
|||
h1 = soup.select_one("h1")
|
||||
self.assertEqual(h1.text.strip(), f"Usage: {self.object}")
|
||||
|
||||
tds = soup.select("tbody tr td")
|
||||
tds = soup.select("#listing-results tbody tr td")
|
||||
self.assertEqual(len(tds), 3)
|
||||
self.assertEqual(tds[0].text.strip(), "(Private various on delete model)")
|
||||
self.assertEqual(tds[1].text.strip(), "Various on delete model")
|
||||
|
@ -1154,7 +1154,7 @@ class TestUsageView(WagtailTestUtils, TestCase):
|
|||
h1 = soup.select_one("h1")
|
||||
self.assertEqual(h1.text.strip(), f"Usage: {self.object}")
|
||||
|
||||
tds = soup.select("tbody tr td")
|
||||
tds = soup.select("#listing-results tbody tr td")
|
||||
self.assertEqual(len(tds), 3)
|
||||
self.assertEqual(tds[0].text.strip(), str(self.tbx))
|
||||
self.assertEqual(tds[1].text.strip(), "Various on delete model")
|
||||
|
|
|
@ -719,10 +719,12 @@ class TestListViewWithCustomColumns(BaseSnippetViewSetTests):
|
|||
# One from the country code column, another from the custom foo column
|
||||
self.assertContains(response, sort_country_code_url, count=2)
|
||||
|
||||
html = response.content.decode()
|
||||
soup = self.get_soup(response.content)
|
||||
|
||||
headings = soup.select("#listing-results table th")
|
||||
|
||||
# The bulk actions column plus 6 columns defined in FullFeaturedSnippetViewSet
|
||||
self.assertTagInHTML("<th>", html, count=7, allow_extra_attrs=True)
|
||||
self.assertEqual(len(headings), 7)
|
||||
|
||||
def test_falsy_value(self):
|
||||
# https://github.com/wagtail/wagtail/issues/10765
|
||||
|
|
Ładowanie…
Reference in New Issue