[FIX] module_analysis : tests compatibility with pip install

pull/2625/head
Florian da Costa 2023-05-18 11:46:08 +02:00
parent 89f8e7b56f
commit a5658ecf6b
1 changed files with 10 additions and 4 deletions

View File

@ -6,12 +6,18 @@ from odoo.tests.common import TransactionCase
class TestModule(TransactionCase):
def setUp(self):
super().setUp()
self.IrModuleModule = self.env["ir.module.module"]
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.IrModuleModule = cls.env["ir.module.module"]
# Remove lib because it breaks tests in case of installation of modules with
# pip
cls.env["ir.config_parameter"].set_param(
"module_analysis.exclude_directories", "demo,test,tests,doc,description"
)
cls.IrModuleModule.cron_analyse_code()
def test_installed_modules(self):
self.IrModuleModule.cron_analyse_code()
installed_modules = self.IrModuleModule.search(
[("state", "=", "installed"), ("name", "not like", "_test")]
)