[Zope3-checkins] CVS: Zope3/src/zope/app/traversing/tests -
test_presentation.py:1.5.30.1
Jim Fulton
cvs-admin at zope.org
Sun Nov 9 11:09:03 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/traversing/tests
In directory cvs.zope.org:/tmp/cvs-serv15349/src/zope/app/traversing/tests
Modified Files:
Tag: adaptergeddon-branch
test_presentation.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/traversing/tests/test_presentation.py 1.5 => 1.5.30.1 ===
--- Zope3/src/zope/app/traversing/tests/test_presentation.py:1.5 Wed Jun 4 04:46:33 2003
+++ Zope3/src/zope/app/traversing/tests/test_presentation.py Sun Nov 9 11:08:30 2003
@@ -18,53 +18,43 @@
"""
from unittest import TestCase, main, makeSuite
+from zope.app.tests import ztapi
from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.component.view import provideView
-from zope.component.resource import provideResource
from zope.app.traversing.namespace import view, resource
from zope.interface import Interface, implements
+from zope.publisher.browser import TestRequest
class IContent(Interface):
pass
-class IPresentationType(Interface):
- pass
-
class Content:
implements(IContent)
class Resource:
- implements(IPresentationType)
def __init__(self, request):
pass
class View:
- implements(IPresentationType)
def __init__(self, content, request):
self.content = content
-class Request:
-
- def getPresentationType(self): return IPresentationType
- def getPresentationSkin(self): return ''
-
class Test(PlacelessSetup, TestCase):
def testView(self):
- provideView(IContent, 'foo', IPresentationType, [View])
+ ztapi.browserView(IContent, 'foo', [View])
ob = Content()
- v = view('foo', (), '@@foo', ob, Request())
+ v = view('foo', (), '@@foo', ob, TestRequest())
self.assertEqual(v.__class__, View)
def testResource(self):
- provideResource('foo', IPresentationType, Resource)
+ ztapi.browserResource('foo', Resource)
ob = Content()
- r = resource('foo', (), '++resource++foo', ob, Request())
+ r = resource('foo', (), '++resource++foo', ob, TestRequest())
self.assertEqual(r.__class__, Resource)
More information about the Zope3-Checkins
mailing list