[Zope3-checkins] CVS: Zope3/src/zope/i18n/tests - test_globaltranslationservice.py:1.8

Fred L. Drake, Jr. fred@zope.com
Thu, 3 Apr 2003 15:20:34 -0500


Update of /cvs-repository/Zope3/src/zope/i18n/tests
In directory cvs.zope.org:/tmp/cvs-serv28385

Modified Files:
	test_globaltranslationservice.py 
Log Message:
Add test of interpolation into a default text.


=== Zope3/src/zope/i18n/tests/test_globaltranslationservice.py 1.7 => 1.8 ===
--- Zope3/src/zope/i18n/tests/test_globaltranslationservice.py:1.7	Fri Mar 28 19:06:26 2003
+++ Zope3/src/zope/i18n/tests/test_globaltranslationservice.py	Thu Apr  3 15:20:34 2003
@@ -114,6 +114,23 @@
         eq(translate('default', 'short_greeting', context=context),
            u'Hello!')
 
+    def testInterpolationWithoutTranslation(self):
+        translate = self._service.translate
+        self.assertEqual(translate("default", "42-not-there",
+                                   target_language="en",
+                                   default="this ${that} the other",
+                                   mapping={"that": "THAT"}),
+                         "this THAT the other")
+        self.assertEqual(translate("no-such-domain", "42-not-there",
+                                   target_language="en",
+                                   default="this ${that} the other",
+                                   mapping={"that": "THAT"}),
+                         "this THAT the other")
+        self.assertEqual(translate("no-such-domain", "42-not-there",
+                                   target_language="en",
+                                   mapping={"that": "THAT"}),
+                         None)
+
 
 def test_suite():
     suite = unittest.TestSuite()