Mirrored from https://github.com/davoodmehraban89/Aram.git
Synced Dec 3, 23:15 UTC
test(mapping): validate excluded account trace consistency
davoodmehraban89 committed
Oct 31, 2026 at 09:36 UTC
c4c656ebe7797fa1366342639964e28386c66e61
1 file changed
+11
backend/tests/test_reconciliation_review.py
+11
@@ -344,3 +344,14 @@ def test_ambiguous_bs_mapping_does_not_hide_valid_eq_mapping_or_pass_review():
344
finding.code == "BLOCKED_ACCOUNT_AMBIGUOUS_ACCOUNT_MAPPING"
345
and finding.account_code == "0010" for finding in reviewed.findings
346
)
347
+
348
+def test_rejects_stale_account_target_for_unapproved_mapping():
349
+ data = workbook(second_draft=True)
350
+ preview = preview_mapping_coverage(data, company_code="001", fiscal_year=1404)
351
+ rows = list(preview.accounts)
352
+ i = next(i for i, row in enumerate(rows) if row.account_code == "0020")
353
+ assert not rows[i].included
354
+ rows[i] = replace(rows[i], target_statement="BS")
355
+ altered = replace(preview, accounts=tuple(rows))
356
+ with pytest.raises(CoverageError):
357
+ _validated_preview(data, altered)