Commit 13cb7d3f authored by Yusei Tahara's avatar Yusei Tahara

Test a case if there is no translation.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31808 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent da369b6a
...@@ -87,6 +87,15 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -87,6 +87,15 @@ class TestContentTranslation(ERP5TypeTestCase):
self.assert_(getattr(person, 'setJaKanaTranslatedFirstName', False)) self.assert_(getattr(person, 'setJaKanaTranslatedFirstName', False))
self.assert_(getattr(person, 'getJaKanaTranslatedFirstName', False)) self.assert_(getattr(person, 'getJaKanaTranslatedFirstName', False))
# if there is no translation, original value is returned.
self.assertEqual('Yusei', person.getTranslatedFirstName())
self.assertEqual('Yusei Tahara', person.getTranslatedTitle())
self.assertEqual('Yusei', person.getJaKanaTranslatedFirstName())
# if no_original_value parameter is true, an empty string is returned.
self.assertEqual('', person.getTranslatedFirstName(no_original_value=True))
self.assertEqual('', person.getTranslatedTitle(no_original_value=True))
self.assertEqual('', person.getJaKanaTranslatedFirstName(no_original_value=True))
person.setJaKanaTranslatedFirstName('タハラ') person.setJaKanaTranslatedFirstName('タハラ')
person.setJaKanaTranslatedLastName('ユウセイ') person.setJaKanaTranslatedLastName('ユウセイ')
...@@ -117,6 +126,7 @@ class TestContentTranslation(ERP5TypeTestCase): ...@@ -117,6 +126,7 @@ class TestContentTranslation(ERP5TypeTestCase):
self.assertEquals(address.getJaKanaTranslatedStreetAddress(), '東京都 台東区') self.assertEquals(address.getJaKanaTranslatedStreetAddress(), '東京都 台東区')
self.assertEquals(address.getTranslatedStreetAddress(language='ja-kana'), '東京都 台東区') self.assertEquals(address.getTranslatedStreetAddress(language='ja-kana'), '東京都 台東区')
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestContentTranslation)) suite.addTest(unittest.makeSuite(TestContentTranslation))
......
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