Files
Odoo-Modules/fusion_accounting_assets/tests/test_migration_round_trip.py
2026-04-19 20:13:30 -04:00

25 lines
1.1 KiB
Python

from odoo.tests.common import TransactionCase
from odoo.tests import tagged
@tagged('post_install', '-at_install')
class TestAssetsMigrationRoundTrip(TransactionCase):
def test_bootstrap_step_runs_without_enterprise(self):
"""When Enterprise account.asset is NOT installed, step is a no-op."""
wizard = self.env['fusion.migration.wizard'].create({})
result = wizard._assets_bootstrap_step()
self.assertEqual(result['step'], 'assets_bootstrap')
# In our local DB, Enterprise account.asset may or may not exist
# If absent: enterprise_module_present is False
# If present: created>=0
self.assertIn(result['enterprise_module_present'], [True, False])
def test_bootstrap_idempotent_on_re_run(self):
wizard = self.env['fusion.migration.wizard'].create({})
first = wizard._assets_bootstrap_step()
second = wizard._assets_bootstrap_step()
# Second run should skip what the first created (or both no-op)
if first['enterprise_module_present']:
self.assertGreaterEqual(second['skipped'], first['created'])