Files
Odoo-Modules/fusion_accounting_assets/tests/test_assets_cron.py
gsinghpal de6d8fda3e
Some checks failed
fusion_accounting CI / test (fusion_accounting_migration) (push) Has been cancelled
fusion_accounting CI / test (fusion_accounting_ai) (push) Has been cancelled
fusion_accounting CI / test (fusion_accounting_core) (push) Has been cancelled
feat(fusion_accounting_assets): 2 cron jobs (depreciation post + anomaly scan)
Made-with: Cursor
2026-04-19 17:17:21 -04:00

29 lines
900 B
Python

"""Cron handler smoke tests."""
from datetime import date
from odoo.tests import tagged
from odoo.tests.common import TransactionCase
@tagged('post_install', '-at_install')
class TestFusionAssetsCron(TransactionCase):
def setUp(self):
super().setUp()
self.cron = self.env['fusion.assets.cron']
self.asset = self.env['fusion.asset'].create({
'name': 'Cron Test', 'cost': 4000,
'acquisition_date': date(2026, 1, 1),
'in_service_date': date(2026, 1, 1),
'method': 'straight_line', 'useful_life_years': 4,
})
self.env['fusion.asset.engine'].compute_depreciation_schedule(self.asset)
self.asset.action_set_running()
def test_cron_post_due_depreciation_runs(self):
self.cron._cron_post_due_depreciation()
def test_cron_anomaly_scan_runs(self):
self.cron._cron_anomaly_scan()