[Zope3-checkins] CVS: Zope3/src/zope/app/form/tests - test_utility.py:1.17 test_widget_geddon_deprecations.py:1.3

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


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

Modified Files:
	test_utility.py test_widget_geddon_deprecations.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/form/tests/test_utility.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/form/tests/test_utility.py:1.16	Wed Aug 13 17:28:38 2003
+++ Zope3/src/zope/app/form/tests/test_utility.py	Fri Nov 21 12:12:04 2003
@@ -19,14 +19,13 @@
 """
 
 from unittest import TestCase, TestSuite, main, makeSuite
+from zope.app.tests import ztapi
 from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.publisher.browser import BrowserView
 from zope.publisher.browser import TestRequest
-from zope.publisher.interfaces.browser import IBrowserPresentation
 from zope.interface import Interface, directlyProvides, implements
 from zope.schema import Text, accessors
 from zope.app.browser.form.widget import TextWidget
-from zope.component.view import provideView, setDefaultViewName
 from zope.schema.interfaces import IText
 from zope.app.interfaces.form import WidgetsError
 from zope.app.form.utility import setUpWidget, setUpWidgets, setUpEditWidgets
@@ -116,8 +115,8 @@
 
     def setUp(self):
         PlacelessSetup.setUp(self)
-        setDefaultViewName(IText, IBrowserPresentation, 'edit')
-        provideView(IText, 'edit', IBrowserPresentation, W)
+        ztapi.setDefaultViewName(IText, 'edit')
+        ztapi.browserView(IText, 'edit', W)
 
 
     def test_setUpWidget(self):


=== Zope3/src/zope/app/form/tests/test_widget_geddon_deprecations.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/form/tests/test_widget_geddon_deprecations.py:1.2	Wed Aug 13 17:28:38 2003
+++ Zope3/src/zope/app/form/tests/test_widget_geddon_deprecations.py	Fri Nov 21 12:12:04 2003
@@ -16,6 +16,7 @@
 $Id$
 """
 
+from zope.app.tests import ztapi
 from zope.testing.doctestunit import DocTestSuite
 from zope.publisher.browser import TestRequest
 from zope.app.form import utility
@@ -23,8 +24,6 @@
 from zope.schema import Text
 from zope.schema.interfaces import IText
 from zope.app.tests.placelesssetup import setUp, tearDown
-from zope.component.view import provideView
-from zope.publisher.interfaces.browser import IBrowserPresentation
 import warnings
 
 class TestWidget(Widget):
@@ -127,7 +126,7 @@
     >>> utility.warn = fakewarn
 
     >>> setUp()
-    >>> provideView(IText, 'test', IBrowserPresentation, TestWidget)
+    >>> ztapi.browserView(IText, 'test', TestWidget)
 
     >>> request = TestRequest()
     >>> view = TestView(None, request)




More information about the Zope3-Checkins mailing list