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

Jim Fulton jim@zope.com
Wed, 28 May 2003 18:16:17 -0400


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

Modified Files:
	test_absoluteurl.py 
Log Message:
Simplified the strategy for handling "side effect" URL path segments.
Before, we created an extra context wrapper for each segment.  Now we
just keep track of the extra names used in the context wrapper for the
original object.


=== Zope3/src/zope/app/browser/tests/test_absoluteurl.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/tests/test_absoluteurl.py:1.10	Tue May 27 10:18:10 2003
+++ Zope3/src/zope/app/browser/tests/test_absoluteurl.py	Wed May 28 18:15:46 2003
@@ -89,10 +89,10 @@
         request = TestRequest()
         request.setViewType(IBrowserPresentation)
 
-        content = ContextWrapper(TrivialContent(), Root(), name='a')
-        content = ContextWrapper(TrivialContent(), content,
-                                 name='.',
-                                 side_effect_name="++skin++ZopeTop")
+        content = ContextWrapper(TrivialContent(), Root(),
+                                 name='a',
+                                 side_effect_names=("++skin++ZopeTop", )
+                                 )
         content = ContextWrapper(TrivialContent(), content, name='b')
         content = ContextWrapper(TrivialContent(), content, name='c')
         view = getView(content, 'absolute_url', request)
@@ -111,9 +111,8 @@
         request.setViewType(IBrowserPresentation)
 
         root = Root()
-        content = ContextWrapper(root, root,
-                                 name='.',
-                                 side_effect_name="++skin++ZopeTop")
+        content = ContextWrapper(root, None,
+                                 side_effect_names=("++skin++ZopeTop", ))
         content = ContextWrapper(TrivialContent(), content, name='a')
         content = ContextWrapper(TrivialContent(), content, name='b')
         content = ContextWrapper(TrivialContent(), content, name='c')
@@ -152,11 +151,12 @@
         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='.',
-                                 side_effect_name="++vh++abc")
+
+        content = ContextWrapper(vh_root, Root(),
+                                 name='a',
+                                 side_effect_names=("++vh++abc", ),
+                                 )
         content = ContextWrapper(TrivialContent(), content, name='b')
         content = ContextWrapper(TrivialContent(), content, name='c')
         view = getView(content, 'absolute_url', request)
@@ -175,8 +175,7 @@
 
         root = Root()
         request._vh_root = ContextWrapper(root, root, name='')
-        content = ContextWrapper(root, root,
-                                 name='.',
+        content = ContextWrapper(root, None,
                                  side_effect_name="++vh++abc")
         content = ContextWrapper(TrivialContent(), content, name='a')
         content = ContextWrapper(TrivialContent(), content, name='b')