[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate/tests -
test_viewzpt.py:1.9.10.1
Jim Fulton
cvs-admin at zope.org
Sun Nov 9 11:08:51 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/pagetemplate/tests
In directory cvs.zope.org:/tmp/cvs-serv15349/src/zope/app/pagetemplate/tests
Modified Files:
Tag: adaptergeddon-branch
test_viewzpt.py
Log Message:
Created a global presentation service that replaces the
global view, resource, and skin services.
Now look up presentation components by adapting from a request type,
rather than adapting to a presentation type.
=== Zope3/src/zope/app/pagetemplate/tests/test_viewzpt.py 1.9 => 1.9.10.1 ===
--- 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 Sun Nov 9 11:08:21 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