feat(fusion_accounting_core): add _fusion_is_enterprise_accounting_installed helper
Made-with: Cursor
This commit is contained in:
@@ -1 +1 @@
|
||||
# Tests populated in Tasks 8-12
|
||||
from . import test_enterprise_detection
|
||||
|
||||
20
fusion_accounting_core/tests/test_enterprise_detection.py
Normal file
20
fusion_accounting_core/tests/test_enterprise_detection.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from odoo.tests.common import TransactionCase, tagged
|
||||
|
||||
|
||||
@tagged('post_install', '-at_install')
|
||||
class TestEnterpriseDetection(TransactionCase):
|
||||
"""Verify the helper that detects Odoo Enterprise accounting installs."""
|
||||
|
||||
def test_helper_returns_bool(self):
|
||||
result = self.env['ir.module.module']._fusion_is_enterprise_accounting_installed()
|
||||
self.assertIsInstance(result, bool)
|
||||
|
||||
def test_helper_matches_actual_state(self):
|
||||
"""Helper should return True iff one of the known Enterprise modules is installed."""
|
||||
installed = self.env['ir.module.module'].sudo().search_count([
|
||||
('name', 'in', ['account_accountant', 'account_reports', 'accountant']),
|
||||
('state', '=', 'installed'),
|
||||
])
|
||||
expected = bool(installed)
|
||||
actual = self.env['ir.module.module']._fusion_is_enterprise_accounting_installed()
|
||||
self.assertEqual(actual, expected)
|
||||
Reference in New Issue
Block a user