"""Test fixtures for accounting_period_sales_approve unit tests.""" from types import SimpleNamespace import pytest from lib.constants import DAG_ACCOUNTING_PERIOD_SALES_APPROVE_TARGET_TYPE @pytest.fixture def mock_accounting_period_sales_approve_event(): """Mock abacus_event that triggers the accounting_period_sales_approve dag.""" return { 'abacus_event_id': 1, 'event_date': '2022-09-15 18:57:21.590679', 'event_name': 'approve_sales_files', 'target_id': 123, 'target_type': DAG_ACCOUNTING_PERIOD_SALES_APPROVE_TARGET_TYPE, 'created_by': 'default_user_id' } @pytest.fixture def mock_accounting_period_sales_approve_dag_run( mock_accounting_period_sales_approve_event ): """Mock accounting_period_sales_approve dag run config.""" return SimpleNamespace(conf=mock_accounting_period_sales_approve_event) @pytest.fixture def mock_accounting_period_abacus_states(): """Mock abacus_state records for an accounting_period.""" return [ { 'abacus_state_id': 1, 'action_name': 'deliver_sales_files', 'action_status': 'complete' }, { 'abacus_state_id': 2, 'action_name': 'approve_sales_files', 'action_status': 'init' }, { 'abacus_state_id': 3, 'action_name': 'mark_runs_as_complete', 'action_status': 'init' }, { 'abacus_state_id': 4, 'action_name': 'calculate_vat', 'action_status': 'init' }, { 'abacus_state_id': 5, 'action_name': 'close_period', 'action_status': 'init' }, ]