Use named arguments for clearer string formatting

Helps when the string is long.

Also helps disambiguate between the CDN domain used for the logos and
those for CSS/JS.
This commit is contained in:
Chris Hill-Scott
2018-11-29 11:41:13 +00:00
parent fe6610c221
commit bc6b9c7af7
7 changed files with 20 additions and 23 deletions

View File

@@ -16,7 +16,7 @@ from app.utils import (
generate_next_dict,
generate_notifications_csv,
generate_previous_dict,
get_cdn_domain,
get_logo_cdn_domain,
)
from tests.conftest import fake_uuid
@@ -278,13 +278,13 @@ def test_generate_notifications_csv_calls_twice_if_next_link(
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()
domain = get_logo_cdn_domain()
assert domain == 'static-logos.notify.tools'
def test_get_cdn_domain_on_non_localhost(client, mocker):
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'https://some.admintest.com'})
domain = get_cdn_domain()
domain = get_logo_cdn_domain()
assert domain == 'static-logos.admintest.com'