"""Tests for branding logic.""" from notifications.logic.branding import BrandParams, get_brand_params def test_get_brand_params(): """Test get_brand_params function.""" # Test prod values assert get_brand_params( identity={'default_brand': 'theorchard'}, environment='prod' ) == BrandParams(brand='orchard', domain='theorchard.com') assert get_brand_params(identity={'default_brand': 'awal'}, environment='prod') == BrandParams( brand='awal', domain='awal.com' ) assert get_brand_params(identity={'default_brand': 'sme'}, environment='prod') == BrandParams( brand='sme', domain='sonymusic.com' ) # Test QA values assert get_brand_params( identity={'default_brand': 'theorchard'}, environment='qa' ) == BrandParams(brand='orchard', domain='qaorch.com') assert get_brand_params(identity={'default_brand': 'awal'}, environment='qa') == BrandParams( brand='awal', domain='qaawal.com' ) assert get_brand_params(identity={'default_brand': 'sme'}, environment='qa') == BrandParams( brand='sme', domain='qapdesuite.com' ) def test_brand_params_properties(): """Test properties of BrandParams.""" # The Orchard brand_params = BrandParams(brand='orchard', domain='theorchard.com') assert brand_params.settings_app_url == 'https://settings.theorchard.com' assert brand_params.content_app_url == 'https://content.theorchard.com' # AWAL brand_params = BrandParams(brand='awal', domain='awal.com') assert brand_params.settings_app_url == 'https://settings.awal.com' assert brand_params.content_app_url == 'https://content.awal.com' # SME (not supported) brand_params = BrandParams(brand='sme', domain='sonymusic.com') assert not brand_params.settings_app_url assert not brand_params.content_app_url