[Zope3-checkins] CVS: Zope3/src/zope/app/browser/tests - test_absoluteurl.py:1.16

Jim Fulton jim at zope.com
Sun Sep 21 13:31:41 EDT 2003


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

Modified Files:
	test_absoluteurl.py 
Log Message:
No-longer use context wrappers.


=== Zope3/src/zope/app/browser/tests/test_absoluteurl.py 1.15 => 1.16 ===
--- Zope3/src/zope/app/browser/tests/test_absoluteurl.py:1.15	Thu Sep  4 10:22:20 2003
+++ Zope3/src/zope/app/browser/tests/test_absoluteurl.py	Sun Sep 21 13:31:10 2003
@@ -30,7 +30,7 @@
 from zope.publisher.http import IHTTPRequest
 from zope.publisher.http import HTTPCharsets
 from zope.publisher.interfaces.browser import IBrowserPresentation
-from zope.app.context import ContextWrapper
+from zope.app.container.contained import contained
 
 
 class IRoot(Interface): pass
@@ -58,7 +58,7 @@
     def testBadObject(self):
         request = TestRequest()
         request.setViewType(IBrowserPresentation)
-        view = getView(None, 'absolute_url', request)
+        view = getView(42, 'absolute_url', request)
         self.assertRaises(TypeError, view.__str__)
 
     def testNoContext(self):
@@ -71,9 +71,9 @@
         request = TestRequest()
         request.setViewType(IBrowserPresentation)
 
-        content = ContextWrapper(TrivialContent(), Root(), name='a')
-        content = ContextWrapper(TrivialContent(), content, name='b')
-        content = ContextWrapper(TrivialContent(), content, name='c')
+        content = contained(TrivialContent(), Root(), name='a')
+        content = contained(TrivialContent(), content, name='b')
+        content = contained(TrivialContent(), content, name='c')
         view = getView(content, 'absolute_url', request)
         self.assertEqual(str(view), 'http://foobar.com/a/b/c')
 
@@ -90,10 +90,10 @@
         request.setViewType(IBrowserPresentation)
 
         vh_root = TrivialContent()
-        content = ContextWrapper(vh_root, Root(), name='a')
-        request._vh_root = ContextWrapper(vh_root, Root(), name='a')
-        content = ContextWrapper(TrivialContent(), content, name='b')
-        content = ContextWrapper(TrivialContent(), content, name='c')
+        content = contained(vh_root, Root(), name='a')
+        request._vh_root = content
+        content = contained(TrivialContent(), content, name='b')
+        content = contained(TrivialContent(), content, name='c')
         view = getView(content, 'absolute_url', request)
         self.assertEqual(str(view), 'http://foobar.com/b/c')
 
@@ -109,11 +109,10 @@
         request.setViewType(IBrowserPresentation)
 
         vh_root = TrivialContent()
-        request._vh_root = ContextWrapper(vh_root, Root(), name='a')
-
-        content = ContextWrapper(vh_root, Root(), name='a')
-        content = ContextWrapper(TrivialContent(), content, name='b')
-        content = ContextWrapper(TrivialContent(), content, name='c')
+        content = contained(vh_root, Root(), name='a')
+        request._vh_root = content
+        content = contained(TrivialContent(), content, name='b')
+        content = contained(TrivialContent(), content, name='c')
         view = getView(content, 'absolute_url', request)
         self.assertEqual(str(view), 'http://foobar.com/b/c')
 
@@ -129,11 +128,11 @@
         request.setViewType(IBrowserPresentation)
 
         root = Root()
-        request._vh_root = ContextWrapper(root, root, name='')
-        content = ContextWrapper(root, None)
-        content = ContextWrapper(TrivialContent(), content, name='a')
-        content = ContextWrapper(TrivialContent(), content, name='b')
-        content = ContextWrapper(TrivialContent(), content, name='c')
+        request._vh_root = contained(root, root, name='')
+        content = contained(root, None)
+        content = contained(TrivialContent(), content, name='a')
+        content = contained(TrivialContent(), content, name='b')
+        content = contained(TrivialContent(), content, name='c')
         view = getView(content, 'absolute_url', request)
         self.assertEqual(str(view), 'http://foobar.com/a/b/c')
 




More information about the Zope3-Checkins mailing list