import pytest from dmp.ad_reporting.models import AdReportingCampaignBenchmarkByAccountCountryDbt from dmp.ad_reporting.repositories import ( AdReportingCampaignBenchmarkByAccountCountryRepository, ) from tests.unit.types import CreateReportingModel class TestAdReportingCampaignBenchmarkByAccountCountryRepository: @pytest.mark.db def test_find_by_account_id( self, repository: AdReportingCampaignBenchmarkByAccountCountryRepository, create_reporting_model: CreateReportingModel, ) -> None: benchmark = create_reporting_model( AdReportingCampaignBenchmarkByAccountCountryDbt ) result = repository.find_by_account_id( vendor_id=benchmark.vendor_id, subaccount_id=benchmark.subaccount_id, ) assert result == [benchmark] @pytest.mark.db def test_find_by_account_id_empty( self, repository: AdReportingCampaignBenchmarkByAccountCountryRepository, ) -> None: result = repository.find_by_account_id( vendor_id=0, subaccount_id=0, ) assert result == []