mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-15 07:18:58 -04:00
Make logo CDN domain into simple config
Having this as a function which does string parsing and manipulation surprised me a bit when I was trying to figure out why something wasn’t working. It’s more in line with the way we do other config like this (for example `ASSET_PATH`) to make it a simple config variable, rather than trying to be clever and guess things based on other config variables. It’s also less code, and is explicit enough that it doesn’t need tests.
This commit is contained in:
@@ -1,18 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from app.utils import get_logo_cdn_domain, merge_jsonlike
|
||||
|
||||
|
||||
def test_get_cdn_domain_on_localhost(client_request, mocker):
|
||||
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'http://localhost:6012'})
|
||||
domain = get_logo_cdn_domain()
|
||||
assert domain == 'static-logos.notify.tools'
|
||||
|
||||
|
||||
def test_get_cdn_domain_on_non_localhost(client_request, mocker):
|
||||
mocker.patch.dict('app.current_app.config', values={'ADMIN_BASE_URL': 'https://some.admintest.com'})
|
||||
domain = get_logo_cdn_domain()
|
||||
assert domain == 'static-logos.admintest.com'
|
||||
from app.utils import merge_jsonlike
|
||||
|
||||
|
||||
@pytest.mark.parametrize("source_object, destination_object, expected_result", [
|
||||
|
||||
Reference in New Issue
Block a user