"""Contract model tests.""" from moneyhub.constants.constants import ContractType from moneyhub.models.contract import Contract from tests.unit.conftest import insert_mock_abacus_event from tests.unit.conftest import insert_mock_account from tests.unit.conftest import insert_mock_contracts from tests.unit.conftest import insert_mock_ledger_account_contract from tests.unit.conftest import insert_mock_reference_payment_entity from tests.unit.conftest import insert_mock_reference_sap_profit_center from tests.unit.conftest import insert_mock_reference_signing_entity def test_contract_type_by_account(): """Test getting contract type by account.""" account_id = 24601 insert_mock_account(account_id) insert_mock_reference_payment_entity() insert_mock_reference_signing_entity() insert_mock_reference_sap_profit_center() insert_mock_contracts() insert_mock_abacus_event() insert_mock_ledger_account_contract(account_id) actual = Contract.get_contract_type_by_account(account_id) actual_contract_type = actual.contract_type assert actual_contract_type == ContractType.DISTRIBUTION