Update emails to use logos cdn

This commit is contained in:
Ken Tsang
2017-07-24 15:20:40 +01:00
parent 220d2fd9fb
commit 6e1bcb8405
4 changed files with 31 additions and 0 deletions

View File

@@ -12,7 +12,10 @@ from app.utils import (
generate_previous_dict,
generate_next_dict,
Spreadsheet,
<<<<<<< HEAD
get_letter_timings,
=======
>>>>>>> Update emails to use logos cdn
get_cdn_domain
)
@@ -156,6 +159,7 @@ def test_generate_notifications_csv_calls_twice_if_next_link(mocker):
assert mock_get_notifications.mock_calls[1][2]['page'] == 2
<<<<<<< HEAD
@freeze_time('2017-07-14 14:59:59') # Friday, before print deadline
@pytest.mark.parametrize('upload_time, expected_print_time, is_printed, expected_earliest, expected_latest', [
@@ -290,13 +294,19 @@ def test_get_estimated_delivery_date_for_letter(
assert timings.latest_delivery.strftime('%A %Y-%m-%d') == expected_latest
=======
>>>>>>> Update emails to use logos cdn
def test_get_cdn_domain_on_localhost(client, mocker):
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'http://localhost:6012'})
domain = get_cdn_domain()
assert domain == 'static-logos.notify.tools'
<<<<<<< HEAD
def test_get_cdn_domain_on_non_localhost(client, mocker):
=======
def test_get_cdn_domain_without_logo_base_domain_env_returns_admin_base_domain(client, mocker):
>>>>>>> Update emails to use logos cdn
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'https://some.admintest.com'})
domain = get_cdn_domain()
assert domain == 'static-logos.admintest.com'