"""Tests for the ReportsTaxInfo model.""" from payee.models.account_tax_info import AccountTaxInfo from tests.utils.factories import AccountTaxInfoFactory def create_account_tax_info(account_fixtures): """Create an AccountTaxInfo instance.""" instance = AccountTaxInfoFactory.create() assert AccountTaxInfo.get_by_id(instance.account_tax_info_id) == instance def test_update_account_tax_info_and_history_relation(account_fixtures): """Create an AccountTaxInfo instance.""" instance = AccountTaxInfoFactory.create() AccountTaxInfo.query.update({'country_of_tax_residence': 'DEU'}) fresh_instance = AccountTaxInfo.get_by_id(instance.account_tax_info_id) assert fresh_instance.country_of_tax_residence == 'DEU' assert fresh_instance.account_tax_info_history[0].country_of_tax_residence == 'USA'