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

@@ -2,6 +2,7 @@ import json
from os import getenv
import newrelic.agent
from notifications_utils import DAILY_MESSAGE_LIMIT
from app.cloudfoundry_config import cloud_config
@@ -44,7 +45,7 @@ class Config(object):
DEFAULT_SERVICE_LIMIT = 50
GLOBAL_SERVICE_MESSAGE_LIMIT = 250000
GLOBAL_SERVICE_MESSAGE_LIMIT = DAILY_MESSAGE_LIMIT
EMAIL_EXPIRY_SECONDS = 3600 # 1 hour
INVITATION_EXPIRY_SECONDS = 3600 * 24 * 2 # 2 days - also set on api

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