[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/tests - test_configure.py:1.2.2.1

Philipp von Weitershausen philikon at philikon.de
Wed Aug 6 11:28:11 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/form/tests
In directory cvs.zope.org:/tmp/cvs-serv14946/browser/form/tests

Modified Files:
      Tag: zcml-interface-field-branch
	test_configure.py 
Log Message:
Fix up tests to use the ConfigurationMachine from zope.app.configure which
is service-aware.


=== Zope3/src/zope/app/browser/form/tests/test_configure.py 1.2 => 1.2.2.1 ===
--- Zope3/src/zope/app/browser/form/tests/test_configure.py:1.2	Mon Jul 28 18:20:22 2003
+++ Zope3/src/zope/app/browser/form/tests/test_configure.py	Wed Aug  6 10:27:37 2003
@@ -16,25 +16,29 @@
 
 import unittest
 
-from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.configuration import xmlconfig
 
+import zope.app.configuration
+import zope.app.component
+import zope.app.component.service
+import zope.app.event
+import zope.app.publisher.browser
+import zope.app.browser.form
+
+from zope.app.tests.placelesssetup import PlacelessSetup
 
 class TestBrowserFormZCML(PlacelessSetup, unittest.TestCase):
 
     def test_load_zcml(self):
-        # XXX Not much of a test.
-        xmlconfig.string(
-            """<configure xmlns='http://namespaces.zope.org/zope'>
-                 <include package='zope.app.component' file='meta.zcml' />
-                 <include package='zope.app.event' file='meta.zcml' />
-                 <include package='zope.app.publisher.browser'
-                          file='meta.zcml' />
-            
-                 <include package='zope.app.browser.form' />
-               </configure>"""
-            )
-
+        sm = zope.app.component.service.globalServiceManager()
+        context = zope.app.configuration.ConfigurationMachine(sm)
+        xmlconfig.registerCommonDirectives(context)
+        xmlconfig.file('meta.zcml', package=zope.app.component, context=context)
+        xmlconfig.file('meta.zcml', package=zope.app.event, context=context)
+        xmlconfig.file('meta.zcml', package=zope.app.publisher.browser,
+                       context=context)
+        xmlconfig.file('meta.zcml', package=zope.app.browser.form,
+                       context=context)
 
 def test_suite():
     return unittest.makeSuite(TestBrowserFormZCML)




More information about the Zope3-Checkins mailing list