import pytest from dmp.rosters.models import ArtistRosterLocalRep from dmp.rosters.repositories import ArtistRosterLocalRepRepository from tests.unit.types import CreateReportingModel class TestArtistRosterLocalRepRepository: @pytest.mark.db def test_find_by_account_and_global_participant_ids( self, repository: ArtistRosterLocalRepRepository, create_reporting_model: CreateReportingModel, ) -> None: local_rep = create_reporting_model(ArtistRosterLocalRep) result = repository.find_by_account_and_global_participant_ids( vendor_id=local_rep.vendor_id, subaccount_id=local_rep.subaccount_id, global_participant_ids=[local_rep.global_participant_id], ) assert result == [local_rep] @pytest.mark.db def test_find_by_account_and_empty_global_participant_ids( self, repository: ArtistRosterLocalRepRepository, create_reporting_model: CreateReportingModel, ) -> None: local_rep = create_reporting_model(ArtistRosterLocalRep) result = repository.find_by_account_and_global_participant_ids( vendor_id=local_rep.vendor_id, subaccount_id=local_rep.subaccount_id, global_participant_ids=[], ) assert result == []