summaryrefslogtreecommitdiff
path: root/openerp/tools/test_reports.py
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2013-03-27 17:40:45 +0100
committerVo Minh Thu <vmt@openerp.com>2013-03-27 17:40:45 +0100
commitd6ea526e364ee80a4ae2874cdcf8b9b10a0e9e6a (patch)
treebbc2648e330cfcb639cb576c017c7c9d667a5514 /openerp/tools/test_reports.py
parent23d672dfc347c1ae0755a580f545ee45cb7b3fd5 (diff)
parent5134bf4b941f6ebea9f2d849808ab890e54f41e2 (diff)
[MERGE] openerp.pooler is deprecated.
bzr revid: vmt@openerp.com-20130327164045-ziw4lj50owdvmfbw
Diffstat (limited to 'openerp/tools/test_reports.py')
-rw-r--r--openerp/tools/test_reports.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/openerp/tools/test_reports.py b/openerp/tools/test_reports.py
index 3fd1ba2fed4..cae54185c9f 100644
--- a/openerp/tools/test_reports.py
+++ b/openerp/tools/test_reports.py
@@ -25,10 +25,10 @@
through the code of yaml tests.
"""
+import openerp
import openerp.report
import openerp.tools as tools
import logging
-import openerp.pooler as pooler
from openerp.tools.safe_eval import safe_eval
from subprocess import Popen, PIPE
import os
@@ -123,7 +123,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
context = context.copy() # keep it local
# TODO context fill-up
- pool = pooler.get_pool(cr.dbname)
+ registry = openerp.registry(cr.dbname)
def log_test(msg, *args):
_logger.log(logging.TEST, " - " + msg, *args)
@@ -145,7 +145,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
raise ValueError('You cannot only specify action_id "%s" without a module name' % action_id)
act_module = our_module
act_xmlid = action_id
- act_model, act_id = pool.get('ir.model.data').get_object_reference(cr, uid, act_module, act_xmlid)
+ act_model, act_id = registry['ir.model.data'].get_object_reference(cr, uid, act_module, act_xmlid)
else:
assert isinstance(action_id, (long, int))
act_model = 'ir.action.act_window' # assume that
@@ -181,11 +181,11 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
log_test("will emulate a %s view: %s#%s",
action['view_type'], datas['res_model'], view_id or '?')
- view_res = pool.get(datas['res_model']).fields_view_get(cr, uid, view_id, action['view_type'], context)
+ view_res = registry[datas['res_model']].fields_view_get(cr, uid, view_id, action['view_type'], context)
assert view_res and view_res.get('arch'), "Did not return any arch for the view"
view_data = {}
if view_res.get('fields',{}).keys():
- view_data = pool.get(datas['res_model']).default_get(cr, uid, view_res['fields'].keys(), context)
+ view_data = registry[datas['res_model']].default_get(cr, uid, view_res['fields'].keys(), context)
if datas.get('form'):
view_data.update(datas.get('form'))
if wiz_data:
@@ -238,7 +238,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
if not datas['res_id']:
# it is probably an orm_memory object, we need to create
# an instance
- datas['res_id'] = pool.get(datas['res_model']).create(cr, uid, view_data, context)
+ datas['res_id'] = registry[datas['res_model']].create(cr, uid, view_data, context)
if not buttons:
raise AssertionError("view form doesn't have any buttons to press!")
@@ -255,7 +255,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
continue
if b['type'] == 'object':
#there we are! press the button!
- fn = getattr(pool.get(datas['res_model']), b['name'])
+ fn = getattr(registry[datas['res_model']], b['name'])
if not fn:
_logger.error("The %s model doesn't have a %s attribute!", datas['res_model'], b['name'])
continue
@@ -281,7 +281,7 @@ def try_report_action(cr, uid, action_id, active_model=None, active_ids=None,
raise Exception("Cannot handle action of type %s" % act_model)
log_test("will be using %s action %s #%d", act_model, act_xmlid, act_id)
- action = pool.get(act_model).read(cr, uid, act_id, context=context)
+ action = registry[act_model].read(cr, uid, act_id, context=context)
assert action, "Could not read action %s[%s]" %(act_model, act_id)
loop = 0
while action: