Commit 16c9ba90 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fix test_06_FrenchTranslationOfMessageWithContext and check if translations...

fix test_06_FrenchTranslationOfMessageWithContext and check if translations for states are well distinguished per portal type.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36860 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ec2493cd
......@@ -206,6 +206,10 @@ class TestWorkflowStateTitleTranslation(ERP5TypeTestCase):
self.fail(self.message)
def afterSetUp(self):
self.portal.Localizer._default_language = 'en'
self.portal.Localizer.set_languages(['en', 'fr'])
def test_01_EnglishTranslation(self, quiet=0, run=run_all_test):
"""
Test English translation
......@@ -274,7 +278,7 @@ class TestWorkflowStateTitleTranslation(ERP5TypeTestCase):
transaction.commit()
self.tic()
self.portal.Localizer.get_selected_language = lambda: self.lang
self.portal.Localizer._default_language = 'fr'
self.assertEquals(item.getTranslatedValidationStateTitle(), 'Draft')
item.validate()
......@@ -283,10 +287,17 @@ class TestWorkflowStateTitleTranslation(ERP5TypeTestCase):
'Validé')
# Now run indexation of translations.
self.portal.ERP5Site_updateTranslationTable()
transaction.commit()
self.tic()
# Ckeck queries with translated workflow state title generated with
# getMessageIdWithContext
self.assertTrue(len(self.portal.portal_catalog(
translated_validation_state_title="En bon usage")))
self.assertEquals(1, len(self.portal.portal_catalog(
translated_validation_state_title="En bon usage")))
self.assertEquals(1, len(self.portal.portal_catalog(
translated_validation_state_title="En bon usage", portal_type='Item')))
self.assertEquals(0, len(self.portal.portal_catalog(
translated_validation_state_title="En bon usage",
portal_type='Organisation')))
@expectedFailure
def test_07_NegatedQueryForTranslation(self, quiet=0, run=run_all_test):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment