[REF] core: move testing-related functions to odoo/tests submodules

Attempts to clean up odoo/module and odoo/service a tad, they still
invoke testing-related utilities but are more logical in what
they *contain*.
This commit is contained in:
Xavier Morel
2020-08-19 07:28:44 +00:00
parent e46a8bc7d9
commit ec8a64a85c
6 changed files with 250 additions and 235 deletions
+3 -5
View File
@@ -16,10 +16,8 @@ import odoo.modules.db
import odoo.modules.graph
import odoo.modules.migration
import odoo.modules.registry
import odoo.tools as tools
from odoo import api, SUPERUSER_ID
from odoo.modules.module import adapt_version, initialize_sys_path, load_openerp_module
from .. import SUPERUSER_ID, api, tools
from .module import adapt_version, initialize_sys_path, load_openerp_module
_logger = logging.getLogger(__name__)
_test_logger = logging.getLogger('odoo.tests')
@@ -271,7 +269,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True,
report.record_result(load_test(idref, mode))
# Python tests
env['ir.http']._clear_routing_map() # force routing map to be rebuilt
report.record_result(odoo.modules.module.run_unit_tests(module_name))
report.record_result(odoo.tests.loader.run_unit_tests(module_name))
# tests may have reset the environment
env = api.Environment(cr, SUPERUSER_ID, {})
module = env['ir.module.module'].browse(module_id)