[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/complexsample/tests - test_widget.py:1.3.2.1

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


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

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


=== Zope3/src/zope/app/browser/form/complexsample/tests/test_widget.py 1.3 => 1.3.2.1 ===
--- Zope3/src/zope/app/browser/form/complexsample/tests/test_widget.py:1.3	Mon Aug  4 10:54:26 2003
+++ Zope3/src/zope/app/browser/form/complexsample/tests/test_widget.py	Wed Aug  6 10:27:34 2003
@@ -16,26 +16,33 @@
 
 import unittest
 
-from zope.app.browser.form.tests import support
-from zope.app.browser.form import vocabularywidget
-from zope.app.interfaces.form import WidgetInputError
-from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.component import getView
-from zope.component.view import provideView
 from zope.interface.declarations import \
      directlyProvides, providedBy, implements
-from zope.publisher.browser import TestRequest
-from zope.publisher.interfaces.browser import IBrowserPresentation
+from zope.configuration import xmlconfig
+from zope.component import getView
+from zope.component.view import provideView
 from zope.schema.interfaces import IVocabularyField
 from zope.schema.interfaces import IVocabularyUniqueListField
 from zope.schema import vocabulary
+from zope.publisher.browser import TestRequest
+from zope.publisher.interfaces.browser import IBrowserPresentation
+
+import zope.app.configuration
+import zope.app.component
+import zope.app.component.service
+import zope.app.event
+import zope.app.schema
+import zope.app.publisher.browser
+import zope.app.browser.form.complexsample
 
+from zope.app.browser.form.tests import support
+from zope.app.browser.form import vocabularywidget
+from zope.app.interfaces.form import WidgetInputError
+from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.app.browser.form.complexsample import complexsample
 from zope.app.browser.form.complexsample.interfaces import \
      ISampleVocabulary, ISampleVocabularyQuery, IFancySampleVocabularyQuery
 
-from zope.configuration import xmlconfig
-
 class MyTerm:
     def __init__(self, value):
         self.value = value
@@ -1098,17 +1105,16 @@
 class ConfigurationTest(PlacelessSetup, unittest.TestCase):
 
     def test_load_zcml(self):
-        xmlconfig.string("""\
-        <zopeConfigure 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.schema' file='meta.zcml' />
-
-          <include package='zope.app.browser.form.complexsample' />
-        </zopeConfigure>
-        """)
-
+        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.schema, context=context)
+        xmlconfig.file('meta.zcml', package=zope.app.publisher.browser,
+                       context=context)
+        xmlconfig.file('configure.zcml', package=zope.app.browser.form.complexsample,
+                       context=context)
 
 def show(s):
     f = file("/dev/tty", "w")




More information about the Zope3-Checkins mailing list