[IMP] better syntax for routing_map cache invalidation

bzr revid: fme@openerp.com-20140320153651-4lkoekzhawny0p85
This commit is contained in:
Fabien Meghazi
2014-03-20 16:36:51 +01:00
parent b8368d8182
commit 0f9905b9f1
2 changed files with 7 additions and 4 deletions
+5
View File
@@ -145,6 +145,11 @@ class ir_http(osv.AbstractModel):
return self._routing_map
def refresh_routing_map(self):
if hasattr(ir_http, '_routing_map'):
del(ir_http._routing_map)
return self.routing_map()
def convert_exception_to(to_type, with_message=False):
""" Should only be called from an exception handler. Fetches the current
exception data from sys.exc_info() and creates a new exception of type
+2 -4
View File
@@ -186,11 +186,9 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
if tools.config.options['test_enable']:
# Yamel test
report.record_result(load_test(module_name, idref, mode))
# Force routing map to be rebuilt between each test suite on modules
registry['ir.http'].refresh_routing_map()
# Python tests
ir_http = registry['ir.http']
if hasattr(ir_http, '_routing_map'):
# Force routing map to be rebuilt between each module test suite
del(ir_http._routing_map)
report.record_result(openerp.modules.module.run_unit_tests(module_name, cr.dbname))
processed_modules.append(package.name)