[Zope3-checkins] CVS: Zope3/src/zope/app/browser/content/tests -
test_imageupload.py:1.5
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:12:25 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/content/tests
In directory cvs.zope.org:/tmp/cvs-serv31883/src/zope/app/browser/content/tests
Modified Files:
test_imageupload.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/content/tests/test_imageupload.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/content/tests/test_imageupload.py:1.4 Wed Apr 30 19:37:51 2003
+++ Zope3/src/zope/app/browser/content/tests/test_imageupload.py Fri Nov 21 12:11:54 2003
@@ -23,14 +23,13 @@
import zope.app.browser.content # for __file__
+from zope.app.tests import ztapi
from zope.app.browser.content.image import ImageUpload
from zope.app.browser.form.editview import EditView
from zope.app.browser.form.widget import BytesWidget, BytesAreaWidget
from zope.app.content.image import Image, IImage
from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.component.view import provideView, setDefaultViewName
from zope.publisher.browser import TestRequest
-from zope.publisher.interfaces.browser import IBrowserPresentation
from zope.schema.interfaces import IField, IBytesLine, IBytes
@@ -44,9 +43,9 @@
PlacelessSetup.setUp(self)
# Configure the widget views
- setDefaultViewName(IField, IBrowserPresentation, 'edit')
- provideView(IBytesLine, 'edit', IBrowserPresentation, BytesWidget)
- provideView(IBytes, 'edit', IBrowserPresentation, BytesAreaWidget)
+ ztapi.setDefaultViewName(IField, 'edit')
+ ztapi.browserView(IBytesLine, 'edit', BytesWidget)
+ ztapi.browserView(IBytes, 'edit', BytesAreaWidget)
icondir = os.path.split(zope.app.browser.content.__file__)[0]
data = open(os.path.join(icondir, 'image_icon.gif'), 'rb').read()
More information about the Zope3-Checkins
mailing list