[Zope3-checkins] CVS: Zope3/src/zope/i18n/tests -
test_itranslationservice.py:1.7
Stephan Richter
srichter at cosmos.phy.tufts.edu
Thu Aug 7 17:26:46 EDT 2003
Update of /cvs-repository/Zope3/src/zope/i18n/tests
In directory cvs.zope.org:/tmp/cvs-serv21743/src/zope/i18n/tests
Modified Files:
test_itranslationservice.py
Log Message:
Allow interpolation of non-string/unicode objects. Are there any objections
to this?
=== Zope3/src/zope/i18n/tests/test_itranslationservice.py 1.6 => 1.7 ===
--- Zope3/src/zope/i18n/tests/test_itranslationservice.py:1.6 Fri Jun 6 15:29:10 2003
+++ Zope3/src/zope/i18n/tests/test_itranslationservice.py Thu Aug 7 16:26:41 2003
@@ -61,7 +61,7 @@
service = self._service
interp = service.interpolate
eq = self.assertEqual
- mapping = {'name': 'Zope', 'version': '3x'}
+ mapping = {'name': 'Zope', 'version': '3x', 'number': 3}
# Test simple interpolations
eq(interp('This is $name.', mapping), 'This is Zope.')
eq(interp('This is ${name}.', mapping), 'This is Zope.')
@@ -77,6 +77,9 @@
# Test escaping the $
eq(interp('This is $$name.', mapping), 'This is $$name.')
eq(interp('This is $${name}.', mapping), 'This is $${name}.')
+ # Test interpolation of non-string objects
+ eq(interp('Number $number.', mapping), 'Number 3.')
+
def testSimpleTranslate(self):
translate = self._service.translate
More information about the Zope3-Checkins
mailing list