"""Unit testcases for LedgerContractFlowthroughCurrentBalance model.""" from ledger.models.ledger_contract_flowthrough_current_balance import ( LedgerContractFlowthroughCurrentBalance, ) from tests.utils.factories import LedgerContractFlowthroughFactory def test_create_ledger_contract_flowthrough_current_balance(mock_event_fixtures): """Create a ledger_contract_flowthrough_current_balance record on ledger_contract_flowthrough insertion.""" mock_ledger_contract_flowthrough = LedgerContractFlowthroughFactory.create() contract_flowthrough_balances = LedgerContractFlowthroughCurrentBalance.query.all() assert len(contract_flowthrough_balances) == 1 assert contract_flowthrough_balances[0].account_id == 1 assert contract_flowthrough_balances[0].contract_id == 1 assert ( contract_flowthrough_balances[0].ledger_contract_flowthrough_id == mock_ledger_contract_flowthrough.ledger_contract_flowthrough_id )