[FIX] base: correct tests
authorChristophe Simonis <chs@openerp.com>
Wed, 8 Jan 2014 15:21:31 +0000 (16:21 +0100)
committerChristophe Simonis <chs@openerp.com>
Wed, 8 Jan 2014 15:21:31 +0000 (16:21 +0100)
bzr revid: chs@openerp.com-20140108152131-9yg2kf0zjvpnnbl7

openerp/addons/base/test/test_osv_expression.yml

index 7a8254c..0a616c3 100644 (file)
 -
     !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'}
         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)"