fix tests

This commit is contained in:
Kenneth Kehl
2023-07-13 08:28:46 -07:00
parent 00edf5d023
commit 4b3ccfeec3
2 changed files with 2 additions and 16 deletions

View File

@@ -18,27 +18,12 @@ def test_renders(client_request, mocker, query_args, result):
assert response.get_data(as_text=True) == 'rendered'
def test_displays_govuk_branding_by_default(client_request):
page = client_request.get('main.email_template', _test_page_title=False)
assert page.find("a", attrs={"href": "https://www.gov.uk"})
def test_displays_govuk_branding(client_request, mock_get_email_branding_with_govuk_brand_type):
page = client_request.get('main.email_template', branding_style="1", _test_page_title=False)
assert page.find("a", attrs={"href": "https://www.gov.uk"})
def test_displays_both_branding(client_request, mock_get_email_branding_with_both_brand_type):
page = client_request.get('main.email_template', branding_style="1", _test_page_title=False)
mock_get_email_branding_with_both_brand_type.assert_called_once_with('1')
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:nth-of-type(3) table > tr:nth-of-type(1) > td:nth-of-type(2)")[0]\
.get_text().strip() == 'Organization text' # brand text is set