[z3-checkins] r14580 - z3/Five/branch/philikon-testing/browser/tests
philikon at codespeak.net
philikon at codespeak.net
Tue Jul 12 22:44:15 CEST 2005
Author: philikon
Date: Tue Jul 12 22:44:12 2005
New Revision: 14580
Modified:
z3/Five/branch/philikon-testing/browser/tests/test_i18n.py
Log:
atomify test
Modified: z3/Five/branch/philikon-testing/browser/tests/test_i18n.py
==============================================================================
--- z3/Five/branch/philikon-testing/browser/tests/test_i18n.py (original)
+++ z3/Five/branch/philikon-testing/browser/tests/test_i18n.py Tue Jul 12 22:44:12 2005
@@ -19,33 +19,33 @@
if __name__ == '__main__':
execfile(os.path.join(sys.path[0], 'framework.py'))
-configure_zcml = """
-<configure
- xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser"
- xmlns:i18n="http://namespaces.zope.org/i18n"
- >
- <configure package="Products.Five.tests">
- <i18n:registerTranslations directory="locales" />
- </configure>
-
- <configure package="Products.Five.browser.tests">
- <browser:page
- for="Products.Five.interfaces.IFolder"
- template="i18n.pt"
- name="i18n.html"
- permission="zope2.View"
- />
- </configure>
-</configure>
-"""
-
-def setUp(test):
- from Products.Five.zcml import load_string
- load_string(configure_zcml)
-
def test_zpt_i18n():
"""
+ Test i18n functionality in ZPTs
+
+ >>> configure_zcml = '''
+ ... <configure
+ ... xmlns="http://namespaces.zope.org/zope"
+ ... xmlns:browser="http://namespaces.zope.org/browser"
+ ... xmlns:i18n="http://namespaces.zope.org/i18n">
+ ... <configure package="Products.Five.tests">
+ ... <i18n:registerTranslations directory="locales" />
+ ... </configure>
+ ... <configure package="Products.Five.browser.tests">
+ ... <browser:page
+ ... for="Products.Five.interfaces.IFolder"
+ ... template="i18n.pt"
+ ... name="i18n.html"
+ ... permission="zope2.View"
+ ... />
+ ... </configure>
+ ... </configure>'''
+
+ >>> import Products.Five
+ >>> from Products.Five import zcml
+ >>> zcml.load_config("configure.zcml", Products.Five)
+ >>> zcml.load_string(configure_zcml)
+
In order to be able to traverse to the PageTemplate view, we need
a traversable object:
@@ -79,10 +79,9 @@
"""
def test_suite():
- from Testing.ZopeTestCase import installProduct, FunctionalDocTestSuite
- installProduct('Five')
+ from Testing.ZopeTestCase import FunctionalDocTestSuite
from zope.testing.doctest import ELLIPSIS
- return FunctionalDocTestSuite(setUp=setUp, optionflags=ELLIPSIS)
+ return FunctionalDocTestSuite(optionflags=ELLIPSIS)
if __name__ == '__main__':
framework()
More information about the z3-checkins
mailing list