diff options
Diffstat (limited to 'openerp/modules/loading.py')
| -rw-r--r-- | openerp/modules/loading.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py index 48c5c5adab5..7ca0a6785d6 100644 --- a/openerp/modules/loading.py +++ b/openerp/modules/loading.py @@ -70,6 +70,9 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= cr.commit() else: cr.rollback() + # avoid keeping stale xml_id, etc. in cache + openerp.modules.registry.RegistryManager.clear_caches(cr.dbname) + def _get_files_of_kind(kind): if kind == 'demo': @@ -179,18 +182,12 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules= migrations.migrate_module(package, 'post') if has_demo: - # launch tests only in demo mode, as most tests will depend - # on demo data. Other tests can be added into the regular - # 'data' section, but should probably not alter the data, - # as there is no rollback. + # 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(module_name, idref, mode)) - - # Run the `fast_suite` and `checks` tests given by the module. - if module_name == 'base': - # Also run the core tests after the database is created. - report.record_result(openerp.modules.module.run_unit_tests('openerp')) - report.record_result(openerp.modules.module.run_unit_tests(module_name)) + # Python tests + report.record_result(openerp.modules.module.run_unit_tests(module_name, cr.dbname)) processed_modules.append(package.name) @@ -244,7 +241,6 @@ def load_marked_modules(cr, graph, states, force, progressdict, report, loaded_m if not processed: break return processed_modules - def load_modules(db, force_demo=False, status=None, update_module=False): # TODO status['progress'] reporting is broken: used twice (and reset each # time to zero) in load_module_graph, not fine-grained enough. |
