diff --git a/tests/app/main/views/test_email_preview.py b/tests/app/main/views/test_email_preview.py index 55421cb7f..9ce465b0f 100644 --- a/tests/app/main/views/test_email_preview.py +++ b/tests/app/main/views/test_email_preview.py @@ -54,7 +54,7 @@ def test_displays_both_branding(client, mock_get_email_branding_with_both_brand_ assert page.find("a", attrs={"href": "https://www.gov.uk"}) assert page.find("img", attrs={"src": re.compile("example.png$")}) - assert page.select("body > table table > tr:nth-of-type(2) > td:nth-of-type(5)")[0]\ + assert page.select("body > table:nth-of-type(3) table > tr:nth-of-type(1) > td:nth-of-type(2)")[0]\ .get_text().strip() == 'Organisation text' # brand text is set @@ -71,7 +71,7 @@ def test_displays_org_branding(client, mock_get_email_branding): assert not page.find("a", attrs={"href": "https://www.gov.uk"}) assert page.find("img", attrs={"src": re.compile("example.png")}) assert not page.select("body > table > tr > td[bgcolor='#f00']") # banner colour is not set - assert page.select("body > table table > tr:nth-of-type(2) > td:nth-of-type(5)")[0]\ + assert page.select("body > table:nth-of-type(1) > tr:nth-of-type(1) > td:nth-of-type(2)")[0]\ .get_text().strip() == 'Organisation text' # brand text is set