[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate/tests -
test_viewzpt.py:1.10
Jim Fulton
cvs-admin at zope.org
Fri Nov 21 12:11:08 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/pagetemplate/tests
In directory cvs.zope.org:/tmp/cvs-serv31192/src/zope/app/pagetemplate/tests
Modified Files:
test_viewzpt.py
Log Message:
Updated to use the presentation service amd request types.
=== Zope3/src/zope/app/pagetemplate/tests/test_viewzpt.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/pagetemplate/tests/test_viewzpt.py:1.9 Thu Aug 21 10:19:28 2003
+++ Zope3/src/zope/app/pagetemplate/tests/test_viewzpt.py Fri Nov 21 12:11:07 2003
@@ -17,8 +17,7 @@
"""
import unittest
-from zope.component import getService
-from zope.app.services.servicenames import Views
+from zope.app import zapi
from zope.interface import Interface, implements
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
@@ -63,25 +62,22 @@
def testViewMapper(self):
the_view = "This is the view"
- class the_view_type(Interface): pass
the_view_name = "some view name"
def ViewMaker(*args, **kw):
return the_view
- getService(None,Views).provideView(I1,
- name=the_view_name,
- type=the_view_type,
- maker=[ViewMaker])
+ from zope.component.interfaces import IPresentationRequest
- from zope.component.interfaces \
- import IPresentationRequest
+ zapi.getService(None, zapi.servicenames.Presentation).provideView(
+ I1,
+ name=the_view_name,
+ type=IPresentationRequest,
+ maker=[ViewMaker])
class MyRequest:
implements(IPresentationRequest)
- def getPresentationType(self):
- return the_view_type
def getPresentationSkin(self):
- return "some skin"
+ return '' # default
request = MyRequest()
More information about the Zope3-Checkins
mailing list