"""Test Setup.""" from decimal import Decimal from dotenv import load_dotenv import pytest load_dotenv() @pytest.fixture def mock_event(): """Mock an event.""" return { 'abacus_event_id': 21, 'target_type': 'accounting_period', 'target_id': '1', 'event_name': 'accounting_period_close', 'timestamp': '1997-07-16T19:20:30.45+01:00', 'user_type': 'royalties', 'user_id': '1' } @pytest.fixture def mock_ledger_payees(): """Mock ledger payees.""" return [ { 'ledger_payee_id': 4, 'payee_id': 1003683, 'abacus_event_id': 1, 'currency_code': 'USD', 'currency_amount': '12.00', }, { 'ledger_payee_id': 5, 'payee_id': 1003897, 'abacus_event_id': 1, 'currency_code': 'USD', 'currency_amount': '13.00' } ] @pytest.fixture def mock_results(): """Mock results.""" return [ { 'currency_code': 'CAD', 'abacus_event_id': 21, 'ledger_type': 'credit', 'model_type': 'payee', 'currency_amount': Decimal('-12.00'), 'payee_id': 1 }, { 'currency_code': 'GBP', 'abacus_event_id': 21, 'ledger_type': 'credit', 'model_type': 'payee', 'currency_amount': Decimal('-13.00'), 'payee_id': 1 } ]