[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/basic/tests - test_standardmacros.py:1.7.30.1

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


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

Modified Files:
      Tag: adaptergeddon-branch
	test_standardmacros.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/browser/skins/basic/tests/test_standardmacros.py 1.7 => 1.7.30.1 ===
--- Zope3/src/zope/app/browser/skins/basic/tests/test_standardmacros.py:1.7	Fri Jun  6 17:35:18 2003
+++ Zope3/src/zope/app/browser/skins/basic/tests/test_standardmacros.py	Sun Nov  9 11:08:11 2003
@@ -17,13 +17,13 @@
 """
 
 import unittest
+from zope.app.tests import ztapi
 from zope.interface import implements
-from zope.app.services.tests.placefulsetup\
+from zope.app.services.tests.placefulsetup \
            import PlacefulSetup
 from zope.component import getService
-from zope.app.services.servicenames import Views
+from zope.publisher.browser import TestRequest
 from zope.publisher.interfaces.browser import IBrowserView
-from zope.publisher.interfaces.browser import IBrowserPresentation
 from zope.interface import Interface
 from zope.app.browser.skins.basic.standardmacros import Macros
 
@@ -48,12 +48,6 @@
 class C:
     implements(I)
 
-class Request:
-    def getPresentationType(self):
-        return IBrowserPresentation
-    def getPresentationSkin(self):
-        return ''
-
 class page1(ViewWithMacros):
     pages = {'foo':'page1_foo',
              'bar':'page1_bar'}
@@ -73,18 +67,15 @@
             self.context = context
             self.request = request
         macro_pages = pages
-    return T(C(), Request())
+    return T(C(), TestRequest())
 
 class Test(PlacefulSetup, unittest.TestCase):
 
     def setUp(self):
         PlacefulSetup.setUp(self)
-        provideView = getService(None,Views).provideView
-        provideView(I, 'page1', IBrowserPresentation, [page1])
-        provideView(I, 'collides_with_page1', IBrowserPresentation,
-                    [collides_with_page1])
-        provideView(I, 'works_with_page1', IBrowserPresentation,
-                    [works_with_page1])
+        ztapi.browserView(I, 'page1', [page1])
+        ztapi.browserView(I, 'collides_with_page1', [collides_with_page1])
+        ztapi.browserView(I, 'works_with_page1',  [works_with_page1])
 
     def testSinglePage(self):
         macros = createMacrosInstance(('page1',))




More information about the Zope3-Checkins mailing list