[Zope3-checkins] CVS: Zope3/src/zope/app/services/translation/tests - test_translationservice.py:1.8
Jim Fulton
jim@zope.com
Fri, 28 Mar 2003 19:06:55 -0500
Update of /cvs-repository/Zope3/src/zope/app/services/translation/tests
In directory cvs.zope.org:/tmp/cvs-serv20015/src/zope/app/services/translation/tests
Modified Files:
test_translationservice.py
Log Message:
Fixed bugs in global translation service:
- Returned message id on failed serach when no message catalogs
were found. Should have returned None.
- Failed lookups with multiple catalogs unless all catalogs had a
translation.
Fixed bug in local translation services:
- Returned message id on failed serach
Added a default argument to translate. This allows the default
text, which could be the message id, to be passed.
=== Zope3/src/zope/app/services/translation/tests/test_translationservice.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/translation/tests/test_translationservice.py:1.7 Tue Mar 25 19:19:57 2003
+++ Zope3/src/zope/app/services/translation/tests/test_translationservice.py Fri Mar 28 19:06:25 2003
@@ -108,7 +108,11 @@
def testAddUpdateDeleteMessage(self):
service = self._service
self.assertEqual(service.translate('test', 'greeting',
- target_language='de'), 'greeting')
+ target_language='de'),
+ None)
+ self.assertEqual(service.translate('test', 'greeting',
+ target_language='de', default=42),
+ 42)
service.addMessage('test', 'greeting', 'Hallo!', 'de')
self.assertEqual(service.translate('test', 'greeting',
target_language='de'), 'Hallo!')