import pytest from dmp.ad_reporting.models import AdReportingCampaignBenchmarkByAccountArtistDbt from dmp.ad_reporting.repositories import ( AdReportingCampaignBenchmarkByAccountArtistRepository, ) from tests.unit.faker import FakerTyped from tests.unit.types import CreateReportingModel class TestAdReportingCampaignBenchmarkByAccountArtistRepository: @pytest.mark.db def test_find_by_account_and_artist_id( self, repository: AdReportingCampaignBenchmarkByAccountArtistRepository, create_reporting_model: CreateReportingModel, ) -> None: artist_benchmark = create_reporting_model( AdReportingCampaignBenchmarkByAccountArtistDbt ) result = repository.find_by_account_and_artist_id( vendor_id=artist_benchmark.vendor_id, subaccount_id=artist_benchmark.subaccount_id, global_participant_id=artist_benchmark.global_participant_id, ) assert result == [artist_benchmark] @pytest.mark.db def test_find_by_account_and_artist_ids_empty( self, repository: AdReportingCampaignBenchmarkByAccountArtistRepository, fake: FakerTyped, ) -> None: result = repository.find_by_account_and_artist_id( vendor_id=1, subaccount_id=0, global_participant_id=fake.uuid4_string(), ) assert result == []