From 4b3ccfeec367bb55d37527d0fd3c6faa50dd3a89 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 13 Jul 2023 08:28:46 -0700 Subject: [PATCH] fix tests --- app/config.py | 3 ++- tests/app/main/views/test_email_preview.py | 15 --------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/app/config.py b/app/config.py index fbf88d38e..568c51be7 100644 --- a/app/config.py +++ b/app/config.py @@ -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 diff --git a/tests/app/main/views/test_email_preview.py b/tests/app/main/views/test_email_preview.py index ef0080471..180f1c7c8 100644 --- a/tests/app/main/views/test_email_preview.py +++ b/tests/app/main/views/test_email_preview.py @@ -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