From 13cb7d3f3c6dfafa6c9cc8332d53ec1b049fa610 Mon Sep 17 00:00:00 2001
From: Yusei Tahara <yusei@nexedi.com>
Date: Tue, 19 Jan 2010 07:29:47 +0000
Subject: [PATCH] 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
---
 product/ERP5/tests/testContentTranslation.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/product/ERP5/tests/testContentTranslation.py b/product/ERP5/tests/testContentTranslation.py
index 33757bde71..e215944035 100644
--- a/product/ERP5/tests/testContentTranslation.py
+++ b/product/ERP5/tests/testContentTranslation.py
@@ -87,6 +87,15 @@ class TestContentTranslation(ERP5TypeTestCase):
     self.assert_(getattr(person, 'setJaKanaTranslatedFirstName', 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.setJaKanaTranslatedLastName('銉︺偊銈汇偆')
 
@@ -117,6 +126,7 @@ class TestContentTranslation(ERP5TypeTestCase):
     self.assertEquals(address.getJaKanaTranslatedStreetAddress(), '鏉变含閮� 鍙版澅鍖�')
     self.assertEquals(address.getTranslatedStreetAddress(language='ja-kana'), '鏉变含閮� 鍙版澅鍖�')
 
+
 def test_suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestContentTranslation))
-- 
2.30.9