[Zope3-checkins] CVS: Zope3/src/zope/app/content/tests - test_zptpage.py:1.14.6.1

Jim Fulton cvs-admin at zope.org
Sun Nov 9 11:08:46 EST 2003


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

Modified Files:
      Tag: adaptergeddon-branch
	test_zptpage.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/content/tests/test_zptpage.py 1.14 => 1.14.6.1 ===
--- Zope3/src/zope/app/content/tests/test_zptpage.py:1.14	Sun Sep 21 13:31:53 2003
+++ Zope3/src/zope/app/content/tests/test_zptpage.py	Sun Nov  9 11:08:16 2003
@@ -19,6 +19,7 @@
 
 import unittest
 
+from zope.app.tests import ztapi
 from zope.interface.verify import verifyClass
 from zope.exceptions import Forbidden
 
@@ -27,8 +28,6 @@
 from zope.app.interfaces.content.zpt import IZPTPage
 from zope.app.interfaces.index.text import ISearchableText
 from zope.component import getAdapter, getView
-from zope.component.view import provideView
-from zope.publisher.interfaces.browser import IBrowserPresentation
 from zope.publisher.browser import TestRequest, BrowserView
 
 # Wow, this is a lot of work. :(
@@ -54,8 +53,7 @@
         provideAdapter(None, ITraversable, DefaultTraversable)
         provideAdapter(IZPTPage, ISearchableText, SearchableText)
         defineChecker(Data, NamesChecker(['URL', 'name']))
-        defineChecker(TestRequest, NamesChecker(['getPresentationType',
-                                                 'getPresentationSkin']))
+        defineChecker(TestRequest, NamesChecker(['getPresentationSkin']))
 
     def testSearchableText(self):
         page = ZPTPage()
@@ -121,7 +119,7 @@
         from zope.app.traversing.namespace import provideNamespaceHandler
         from zope.app.traversing.namespace import view
         provideNamespaceHandler('view', view)
-        provideView(IZPTPage, 'name', IBrowserPresentation, AU)
+        ztapi.browserView(IZPTPage, 'name', AU)
 
         page = ZPTPage()
         page.setSource(
@@ -129,7 +127,6 @@
             )
         page = contained(page, None, name='zpt')
         request = TestRequest()
-        request.setViewType(IBrowserPresentation)
         self.assertEquals(page.render(request), 'zpt\n')
 
 
@@ -197,7 +194,7 @@
 
     def setUp(self):
         PlacelessSetup.setUp(self)
-        provideView(IZPTPage, 'source.html', IBrowserPresentation, ZPTSourceView)
+        ztapi.browserView(IZPTPage, 'source.html', ZPTSourceView)
 
     def testSourceView(self):
         page = ZPTPage()




More information about the Zope3-Checkins mailing list