[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container/tests - test_adding.py:1.11.6.1

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


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

Modified Files:
      Tag: adaptergeddon-branch
	test_adding.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/container/tests/test_adding.py 1.11 => 1.11.6.1 ===
--- Zope3/src/zope/app/browser/container/tests/test_adding.py:1.11	Sun Sep 21 13:30:25 2003
+++ Zope3/src/zope/app/browser/container/tests/test_adding.py	Sun Nov  9 11:08:03 2003
@@ -18,6 +18,7 @@
 
 from unittest import TestCase, main, makeSuite
 from zope.app import zapi
+from zope.app.tests import ztapi
 from zope.app.browser.absoluteurl import AbsoluteURL
 from zope.app.browser.container.adding import Adding
 from zope.app.event.tests.placelesssetup import getEvents
@@ -27,13 +28,11 @@
 from zope.app.interfaces.exceptions import UserError
 from zope.app.interfaces.traversing import IContainmentRoot
 from zope.app.tests.placelesssetup import PlacelessSetup
-from zope.component.view import provideView
 from zope.component.factory import provideFactory
 from zope.component.interfaces import IFactory
 from zope.component.exceptions import ComponentLookupError
 from zope.interface import implements, Interface, directlyProvides
 from zope.publisher.browser import TestRequest, BrowserView
-from zope.publisher.interfaces.browser import IBrowserPresentation
 from zope.app.container.contained import contained
 import zope.security.checker
 from zope.exceptions import ForbiddenAttribute
@@ -87,7 +86,7 @@
         container = Container()
         request = TestRequest()
         adding = Adding(container, request)
-        provideView(IAdding, "Thing", IBrowserPresentation, CreationView)
+        ztapi.browserView(IAdding, "Thing", CreationView)
         self.assertEqual(adding.contentName, None)
         view = adding.publishTraverse(request, 'Thing=foo')
         self.assertEqual(view.action(), 'been there, done that')
@@ -104,7 +103,7 @@
         container = Container()
         request = TestRequest()
         adding = Adding(container, request)
-        provideView(IAdding, "Thing", IBrowserPresentation, CreationView)
+        ztapi.browserView(IAdding, "Thing", CreationView)
 
         self.assertEqual(adding.contentName, None)
         view = adding.publishTraverse(request, 'Thing=')
@@ -166,9 +165,8 @@
         request = TestRequest()
         adding = Adding(container, request)
         adding.__name__ = '+'
-        provideView(IAdding, "Thing", IBrowserPresentation, CreationView)
-        provideView(Interface, "absolute_url", IBrowserPresentation,
-                    AbsoluteURL)
+        ztapi.browserView(IAdding, "Thing", CreationView)
+        ztapi.browserView(Interface, "absolute_url", AbsoluteURL)
         self.assertRaises(UserError, adding.action, '', 'foo')
         self.assertRaises(UserError, adding.action, 'Unknown', '')
         adding.action('Thing', 'foo')




More information about the Zope3-Checkins mailing list