import pytest from faker import Faker from dmp.artists.repositories import ArtistAccountRepository from dmp.fandata.models import FansByArtistAccountDbt from tests.unit.types import CreateReportingModel class TestArtistAccountRepository: @pytest.mark.db def test_find_accounts_having_fandata_empty( self, repository: ArtistAccountRepository, create_reporting_model: CreateReportingModel, faker: Faker, ) -> None: global_participant_id = faker.uuid4() vendor_1 = 1 vendor_2 = 2 create_reporting_model( FansByArtistAccountDbt, global_participant_id=global_participant_id, vendor_id=vendor_1, ) create_reporting_model( FansByArtistAccountDbt, global_participant_id=global_participant_id, vendor_id=vendor_2, ) create_reporting_model( FansByArtistAccountDbt, global_participant_id=global_participant_id, vendor_id=faker.pyint(), ) accounts = repository.find_accounts_having_fandata( global_participant_id=global_participant_id, vendor_ids=[vendor_1, vendor_2], subaccount_ids=[], ) assert len(accounts) == 2