[z3-checkins] r14562 - z3/Five/branch/philikon-testing/tests

philikon at codespeak.net philikon at codespeak.net
Tue Jul 12 20:01:28 CEST 2005


Author: philikon
Date: Tue Jul 12 20:01:24 2005
New Revision: 14562

Modified:
   z3/Five/branch/philikon-testing/tests/test_i18n.py
Log:
atomify i18n test


Modified: z3/Five/branch/philikon-testing/tests/test_i18n.py
==============================================================================
--- z3/Five/branch/philikon-testing/tests/test_i18n.py	(original)
+++ z3/Five/branch/philikon-testing/tests/test_i18n.py	Tue Jul 12 20:01:24 2005
@@ -21,6 +21,17 @@
 
 def test_directive():
     """
+    Test the i18n directive
+
+      >>> from zope.app.tests.placelesssetup import setUp, tearDown
+      >>> setUp()
+
+    First, we need to register the ZCML directive:
+
+      >>> import zope.app.i18n
+      >>> from Products.Five import zcml
+      >>> zcml.load_config('meta.zcml', zope.app.i18n)
+
     Let's register the gettext locales using the ZCML directive:
 
       >>> configure_zcml = '''
@@ -29,8 +40,6 @@
       ...            package="Products.Five.tests">
       ...   <i18n:registerTranslations directory="locales" />
       ... </configure>'''
-
-      >>> from Products.Five import zcml
       >>> zcml.load_string(configure_zcml)
 
     Now, take an arbitrary message id from that domain:
@@ -47,11 +56,15 @@
       u'This is an explicit message'
       >>> translate(msg, target_language='de')
       u'Dies ist eine explizite Nachricht'
+
+
+    Clean up:
+
+      >>> tearDown()
     """
 
 def test_suite():
-    from Testing.ZopeTestCase import installProduct, ZopeDocTestSuite
-    installProduct('Five')
+    from Testing.ZopeTestCase import ZopeDocTestSuite
     return ZopeDocTestSuite()
 
 if __name__ == '__main__':


More information about the z3-checkins mailing list