From 3f884fbe3ff1ecdb343389e21630e2b89d9bd761 Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Tue, 21 May 2019 13:00:04 +0000 Subject: [PATCH] [IMP] loading: tests are allowed without demo data As most of the tests are using demo data, a check is performed to verify that they are loaded. A best practice is to write tests that does not depend on demo data but with this check, it's not possible to launch them without demo data. With this commit, the check is removed, allowing to launch test even without demo data loaded. closes odoo/odoo#33531 Signed-off-by: Christophe Monniez (moc) --- odoo/modules/loading.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/odoo/modules/loading.py b/odoo/modules/loading.py index 6b924f09bf4..e256711e06f 100644 --- a/odoo/modules/loading.py +++ b/odoo/modules/loading.py @@ -246,17 +246,15 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, # update made to the schema or data so the tests can run # (separately in their own transaction) cr.commit() - if demo_loaded: - # launch tests only in demo mode, allowing tests to use demo data. - if tools.config.options['test_enable']: - # Yamel test - 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, cr.dbname)) - # tests may have reset the environment - env = api.Environment(cr, SUPERUSER_ID, {}) - module = env['ir.module.module'].browse(module_id) + + if tools.config.options['test_enable']: + 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, cr.dbname)) + # tests may have reset the environment + env = api.Environment(cr, SUPERUSER_ID, {}) + module = env['ir.module.module'].browse(module_id) processed_modules.append(package.name)