[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form - widget.py:1.57

Jim Fulton cvs-admin at zope.org
Fri Nov 21 12:12:55 EST 2003


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

Modified Files:
	widget.py 
Log Message:
Changed to use the new ztapi module, which provides handy functions
for setting up adapters and views for tests.  This is needed because
there are no-longer global adapter and view services sitting around as
module globals.


=== Zope3/src/zope/app/browser/form/widget.py 1.56 => 1.57 ===
--- Zope3/src/zope/app/browser/form/widget.py:1.56	Mon Nov  3 16:38:01 2003
+++ Zope3/src/zope/app/browser/form/widget.py	Fri Nov 21 12:11:55 2003
@@ -23,6 +23,7 @@
 from xml.sax.saxutils import quoteattr
 
 from zope.app import zapi
+from zope.app.tests import ztapi
 from zope.component import getService
 from zope.interface import implements
 from zope.proxy import removeAllProxies
@@ -49,17 +50,14 @@
     a lot of machinery to support translation and views:
 
     >>> setUp() # now we have to set up an error view...
-    >>> from zope.component.view import provideView
     >>> from zope.app.interfaces.form import IWidgetInputError
-    >>> from zope.publisher.browser import IBrowserPresentation
     >>> from zope.app.publisher.browser import BrowserView
     >>> from cgi import escape
     >>> class SnippetErrorView(BrowserView):
     ...     def __call__(self):
     ...         return escape(self.context.errors[0])
     ...
-    >>> provideView(IWidgetInputError, 'snippet',
-    ...             IBrowserPresentation, SnippetErrorView)
+    >>> ztapi.browserView(IWidgetInputError, 'snippet', SnippetErrorView)
     >>> from zope.publisher.browser import TestRequest
 
     And now the tests proper...




More information about the Zope3-Checkins mailing list