"""Test for application model.""" import pytest from account.models import application @pytest.mark.parametrize( 'application_id, company_brand_name, expected_url', [ pytest.param( application.BANKING_TAX_APP, 'awal', 'https://documents.awal.com', id='Banking Tax - AWAL', ), pytest.param( application.CUSTOMER_ACCOUNTING_APP, 'knr', 'https://accounting.kollectivenr.com', id='Customer Accounting - KNR', ), pytest.param( application.COLLABORATORS_APP, 'theorchard', 'https://collaborators.theorchard.com', id='Collaborators - The Orchard', ), pytest.param( application.WORKSTATION_ACCOUNTING_APP, 'theorchard', 'https://workstation.theorchard.com/accounting', id='Workstation Accounting - The Orchard', ), pytest.param( application.INSIGHTS_APP, 'sme', 'https://insights.sonymusic.com', id='Insights - SME' ), pytest.param( application.INSIGHTS_APP, 'knr', 'https://insights.sonymusic.com', id='Insights - KNR (override to SME domain)', ), pytest.param( application.WORKSTATION_ANALYTICS_APP, 'theorchard', 'https://workstation.theorchard.com/analytics', id='Workstation Analytics - The Orchard', ), pytest.param( application.WORKSTATION_CATALOG_APP, 'awal', 'https://workstation.awal.com/catalog', id='Workstation Catalog - AWAL', ), pytest.param( application.WORKSTATION_MARKETING_APP, 'theorchard', 'https://workstation.theorchard.com/marketing2', id='Workstation Marketing - The Orchard', ), pytest.param( application.FANSIFTER_APP, 'sme', 'https://fansifter.sonymusic.com', id='Fansifter - SME', ), pytest.param( application.SONGWHIP_APP, 'awal', 'https://songwhip.com', id='Songwhip - AWAL' ), pytest.param( application.SETTINGS_APP, 'theorchard', 'https://settings.theorchard.com', id='Settings - The Orchard', ), pytest.param( application.SETTINGS_APP, 'altafonte', 'https://settings.theorchard.com', id='Settings - altafonte', ), pytest.param( application.INSIGHTS_APP, 'foundation', 'https://insights.sonymusic.com', id='Insights - Foundation', ), ], ) def test_get_application_url(application_id: str, company_brand_name: str, expected_url: str): assert application.get_application_url(application_id, company_brand_name) == expected_url @pytest.mark.parametrize( 'application_id, company_brand_name, error', [ pytest.param( 'non_existent_app', 'awal', 'Application non_existent_app not found.', id='Non-existent App', ), pytest.param( 'SONGWHIP_APP', 'rando', 'Invalid Company brand rando.', id='Invalid Company Brand' ), ], ) def test_get_application_invalid_inputs(application_id: str, company_brand_name: str, error: str): with pytest.raises(ValueError, match=error): application.get_application_url(application_id, company_brand_name)