From a6c73c00b41a42ff2f6fcf6b004f13141790d19b Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Wed, 8 Jan 2014 16:21:31 +0100 Subject: [PATCH] [FIX] base: correct tests bzr revid: chs@openerp.com-20140108152131-9yg2kf0zjvpnnbl7 --- openerp/addons/base/test/test_osv_expression.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openerp/addons/base/test/test_osv_expression.yml b/openerp/addons/base/test/test_osv_expression.yml index 7a8254c..0a616c3 100644 --- a/openerp/addons/base/test/test_osv_expression.yml +++ b/openerp/addons/base/test/test_osv_expression.yml @@ -541,9 +541,16 @@ - !python {model: res.country}: | # first install french language - BLI = self.pool.get('base.language.install') - BLI.lang_install(cr, uid, [BLI.create(cr, uid, {'lang': 'fr_FR'})]) + Modules = self.pool.get('ir.module.module') + base = Modules.browse(cr, uid, Modules.search(cr, uid, [('name', '=', 'base')])[0]) + + # hack: mark module as installed to allow install of the translation + base_state = base.state + base.write({'state': 'installed'}) + base.update_translations('fr_FR') + base.write({'state': base_state}) + # tests be_id = self.search(cr, uid, [('name', '=', 'Belgium')])[0] ctx = {'lang': 'fr_FR'} @@ -555,8 +562,8 @@ Partners = self.pool.get('res.partner') agrolait = Partners.search(cr, uid, [('name', '=', 'Agrolait')])[0] - not_be = Partners.search(cr, uid, [('country_id', '!=', 'Belgium')]) + not_be = Partners.search(cr, uid, [('country', '!=', 'Belgium')]) assert agrolait not in not_be, "Search match failed (m2o)" - not_be = Partners.search(cr, uid, [('country_id', '!=', 'Belgique')], context=ctx) + not_be = Partners.search(cr, uid, [('country', '!=', 'Belgique')], context=ctx) assert agrolait not in not_be, "Search match failed (m2o)" -- 1.7.10.4