Skip to content
Permalink
Browse files

adapt test

Remove translation as was only checking that the translations are
correctly loaded anyway
  • Loading branch information...
mart-e committed Nov 8, 2019
1 parent c63163c commit 24885e817627d913e4facf4ca882b3889fc84110
Showing with 2 additions and 6 deletions.
  1. +2 −1 odoo/addons/base/tests/test_expression.py
  2. +0 −5 odoo/addons/test_new_api/tests/test_ui.py
@@ -673,11 +673,12 @@ def test_lp1071710(self):
""" Check that we can exclude translated fields (bug lp:1071710) """
# first install french language
self.env['res.lang']._activate_lang('fr_FR')
self.env.ref('base.module_base')._update_translations(['fr_FR'])
self.env['res.partner'].search([('name', '=', 'Pepper Street')]).country_id = self.env.ref('base.be')
# actual test
Country = self.env['res.country'].with_context(lang='fr_FR')
be = self.env.ref('base.be')
be.with_context(lang='fr_FR').name = "Belgique"
self.assertNotEqual(be.name, "Belgique", "Setting a translation should not impact other languages")
not_be = self._search(Country, [('name', '!=', 'Belgique')])
self.assertNotIn(be, not_be)

@@ -27,11 +27,6 @@ class TestUiTranslation(odoo.tests.HttpCase):
@mute_logger('odoo.sql_db', 'odoo.http')
def test_01_sql_constraints(self):
# Raise an SQL constraint and test the message
self.env['res.lang']._activate_lang('fr_FR')
self.env.ref('base.module_test_new_api')._update_translations(['fr_FR'])
constraint = self.env.ref('test_new_api.constraint_test_new_api_category_positive_color')
message = constraint.with_context(lang='fr_FR').message
self.assertEqual(message, "La couleur doit être une valeur positive !")

# TODO: make the test work with French translations. As the transaction
# is rollbacked at insert and a new cursor is opened, can not test that

0 comments on commit 24885e8

Please sign in to comment.
You can’t perform that action at this time.