feat(fusion_accounting_reports): 2 cron jobs (anomaly scan + MV refresh)

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-04-19 15:54:50 -04:00
parent 9db7271bdf
commit 97640a5ac8
6 changed files with 165 additions and 1 deletions

View File

@@ -17,3 +17,4 @@ from . import test_engine_property
from . import test_pnl_integration
from . import test_bs_tb_integration
from . import test_account_balance_mv
from . import test_cron

View File

@@ -0,0 +1,20 @@
"""Tests for cron handlers."""
from odoo.tests.common import TransactionCase, tagged
@tagged('post_install', '-at_install')
class TestFusionReportsCron(TransactionCase):
def setUp(self):
super().setUp()
self.cron = self.env['fusion.reports.cron']
def test_cron_mv_refresh_does_not_raise(self):
# Smoke test: the cron must complete without raising even if the
# CONCURRENTLY path fails on a cold MV (the handler falls back).
self.cron._cron_mv_refresh()
def test_cron_anomaly_scan_does_not_raise(self):
# Smoke test: scan all companies, persist anomalies, no exceptions.
self.cron._cron_anomaly_scan()