mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
fix tests
This commit is contained in:
@@ -2,6 +2,7 @@ import json
|
|||||||
from os import getenv
|
from os import getenv
|
||||||
|
|
||||||
import newrelic.agent
|
import newrelic.agent
|
||||||
|
from notifications_utils import DAILY_MESSAGE_LIMIT
|
||||||
|
|
||||||
from app.cloudfoundry_config import cloud_config
|
from app.cloudfoundry_config import cloud_config
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ class Config(object):
|
|||||||
|
|
||||||
DEFAULT_SERVICE_LIMIT = 50
|
DEFAULT_SERVICE_LIMIT = 50
|
||||||
|
|
||||||
GLOBAL_SERVICE_MESSAGE_LIMIT = 250000
|
GLOBAL_SERVICE_MESSAGE_LIMIT = DAILY_MESSAGE_LIMIT
|
||||||
|
|
||||||
EMAIL_EXPIRY_SECONDS = 3600 # 1 hour
|
EMAIL_EXPIRY_SECONDS = 3600 # 1 hour
|
||||||
INVITATION_EXPIRY_SECONDS = 3600 * 24 * 2 # 2 days - also set on api
|
INVITATION_EXPIRY_SECONDS = 3600 * 24 * 2 # 2 days - also set on api
|
||||||
|
|||||||
@@ -18,27 +18,12 @@ def test_renders(client_request, mocker, query_args, result):
|
|||||||
assert response.get_data(as_text=True) == 'rendered'
|
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):
|
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)
|
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')
|
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.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]\
|
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
|
.get_text().strip() == 'Organization text' # brand text is set
|
||||||
|
|||||||
Reference in New Issue
Block a user