[FIX] test_impex: fix tests, do not create languages but activate them

This commit is contained in:
Raphael Collet
2015-10-26 17:34:34 +01:00
parent 8eedea6093
commit e039dc6a0b
3 changed files with 4 additions and 33 deletions
@@ -238,14 +238,7 @@ class test_selection(CreatorCase):
[[u"Bar"]])
def test_localized_export(self):
self.registry('res.lang').create(self.cr, openerp.SUPERUSER_ID, {
'name': u'Français',
'code': 'fr_FR',
'translatable': True,
'date_format': '%d.%m.%Y',
'decimal_point': ',',
'thousands_sep': ' ',
})
self.registry('res.lang').load_lang(self.cr, openerp.SUPERUSER_ID, 'fr_FR')
Translations = self.registry('ir.translation')
for source, value in self.translations_fr:
Translations.create(self.cr, openerp.SUPERUSER_ID, {
+2 -16
View File
@@ -394,14 +394,7 @@ class test_selection(ImporterCase):
self.assertEqual([3, 2, 1, 2], values(self.read()))
def test_imported_translated(self):
self.registry('res.lang').create(self.cr, openerp.SUPERUSER_ID, {
'name': u'Français',
'code': 'fr_FR',
'translatable': True,
'date_format': '%d.%m.%Y',
'decimal_point': ',',
'thousands_sep': ' ',
})
self.registry('res.lang').load_lang(self.cr, openerp.SUPERUSER_ID, 'fr_FR')
Translations = self.registry('ir.translation')
for source, value in self.translations_fr:
Translations.create(self.cr, openerp.SUPERUSER_ID, {
@@ -461,14 +454,7 @@ class test_selection_function(ImporterCase):
def test_translated(self):
""" Expects output of selection function returns translated labels
"""
self.registry('res.lang').create(self.cr, openerp.SUPERUSER_ID, {
'name': u'Français',
'code': 'fr_FR',
'translatable': True,
'date_format': '%d.%m.%Y',
'decimal_point': ',',
'thousands_sep': ' ',
})
self.registry('res.lang').load_lang(self.cr, openerp.SUPERUSER_ID, 'fr_FR')
Translations = self.registry('ir.translation')
for source, value in self.translations_fr:
Translations.create(self.cr, openerp.SUPERUSER_ID, {
+1 -9
View File
@@ -76,15 +76,7 @@ class ImporterCase(common.TransactionCase):
return '__test__.' + name
def add_translations(self, name, type, code, *tnx):
Lang = self.registry('res.lang')
if not Lang.search(self.cr, openerp.SUPERUSER_ID, [('code', '=', code)]):
Lang.create(self.cr, openerp.SUPERUSER_ID, {
'name': code,
'code': code,
'translatable': True,
'date_format': '%d.%m.%Y',
'decimal_point': ',',
})
self.registry('res.lang').load_lang(self.cr, openerp.SUPERUSER_ID, code)
Translations = self.registry('ir.translation')
for source, value in tnx:
Translations.create(self.cr, openerp.SUPERUSER_ID, {