[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests - testAbsoluteURL.py:1.1.2.5.4.1

Jim Fulton jim@zope.com
Wed, 29 May 2002 11:10:20 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests

Modified Files:
      Tag: Zope3InWonderland-branch
	testAbsoluteURL.py 
Log Message:
- Added permission_id attribute to adapter and utility directives.

- Got rid of old getView, getResource, and getDefaultViewName.
  Renamed getRequestView to getView (and so on).

  Changed view interface to use context, rather than getContext.

  Introduced notion of presentation types (e.g. IBrowserPresentation, 
  which is cleaner than IBrowserPublisher).

- Began converting to get/queryFoo, which is much nicer.

- Many formatting fixups.



=== Zope3/lib/python/Zope/App/ZopePublication/AbsoluteURL/tests/testAbsoluteURL.py 1.1.2.5 => 1.1.2.5.4.1 ===
 from Zope.ComponentArchitecture.tests.PlacelessSetup import PlacelessSetup
 
-from Zope.ComponentArchitecture import getService, getRequestView
+from Zope.ComponentArchitecture import getService, getView
 from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
 from Zope.Publisher.HTTP.tests.TestRequest import TestRequest
 from Zope.Proxy.ContextWrapper import ContextWrapper
@@ -38,19 +38,19 @@
         from Zope.App.ZopePublication.AbsoluteURL.AbsoluteURL \
              import AbsoluteURL, SiteAbsoluteURL
         provideView=getService(None,"Views").provideView
-        provideView(None, 'absolute_url', IBrowserPublisher, AbsoluteURL)
-        provideView(IRoot, 'absolute_url', IBrowserPublisher, SiteAbsoluteURL)
+        provideView(None, 'absolute_url', IBrowserPublisher, [AbsoluteURL])
+        provideView(IRoot, 'absolute_url', IBrowserPublisher, [SiteAbsoluteURL])
 
     def testBadObject(self):
         request = TestRequest()
         request.setViewType(IBrowserPublisher)
-        view = getRequestView(None, 'absolute_url', request)
+        view = getView(None, 'absolute_url', request)
         self.assertRaises(TypeError, view.__str__)
         
     def testNoContext(self):
         request = TestRequest()
         request.setViewType(IBrowserPublisher)
-        view = getRequestView(Root(), 'absolute_url', request)
+        view = getView(Root(), 'absolute_url', request)
         self.assertEqual(str(view), 'http://foobar.com')
         
     def testBasicContext(self):
@@ -60,7 +60,7 @@
         content = ContextWrapper(object(), Root(), name='a')
         content = ContextWrapper(object(), content, name='b')
         content = ContextWrapper(object(), content, name='c')
-        view = getRequestView(content, 'absolute_url', request)
+        view = getView(content, 'absolute_url', request)
         self.assertEqual(str(view), 'http://foobar.com/a/b/c')
 
 def test_suite():