[Zope3-checkins] CVS: Zope3/src/zope/app/content/tests - test_dtmlpage.py:1.6 test_zptpage.py:1.14

Jim Fulton jim at zope.com
Sun Sep 21 13:32:24 EDT 2003


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

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


=== Zope3/src/zope/app/content/tests/test_dtmlpage.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/content/tests/test_dtmlpage.py:1.5	Tue May 27 10:18:14 2003
+++ Zope3/src/zope/app/content/tests/test_dtmlpage.py	Sun Sep 21 13:31:53 2003
@@ -26,8 +26,8 @@
 from zope.app.traversing.adapters import Traverser, DefaultTraversable
 from zope.app.interfaces.traversing import ITraverser, ITraversable
 from zope.component.adapter import provideAdapter
-from zope.context import Wrapper
 from zope.security.checker import NamesChecker, defineChecker
+from zope.app.container.contained import contained
 
 
 class Data(object):
@@ -58,7 +58,7 @@
             '</a></body></html>'
             )
 
-        page = Wrapper(page, Data(name='zope'))
+        page = contained(page, Data(name='zope'))
 
         out = page.render(Data(URL={'1': 'http://foo.com/'}),
                           title="Zope rules")


=== Zope3/src/zope/app/content/tests/test_zptpage.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/content/tests/test_zptpage.py:1.13	Wed Aug  6 10:45:14 2003
+++ Zope3/src/zope/app/content/tests/test_zptpage.py	Sun Sep 21 13:31:53 2003
@@ -37,9 +37,9 @@
 from zope.app.interfaces.traversing import ITraverser
 from zope.app.interfaces.traversing import ITraversable
 from zope.component.adapter import provideAdapter
-from zope.app.context import ContextWrapper
-from zope.context import Wrapper, getInnerWrapperData
 from zope.security.checker import NamesChecker, defineChecker
+from zope.app.container.contained import contained
+
 
 class Data(object):
     def __init__(self, **kw):
@@ -85,7 +85,7 @@
             '</a></body></html>'
             )
 
-        page = Wrapper(page, Data(name='zope'))
+        page = contained(page, Data(name='zope'))
 
         out = page.render(Data(URL={'1': 'http://foo.com/'}),
                           title="Zope rules")
@@ -105,7 +105,7 @@
             u'<p tal:content="python: request.__dict__" />'
             )
 
-        page = Wrapper(page, Data(name='zope'))
+        page = contained(page, Data(name='zope'))
 
         self.assertRaises(Forbidden, page.render, Data())
 
@@ -113,8 +113,10 @@
 
         class AU(BrowserView):
             def __str__(self):
-                dict = getInnerWrapperData(self.context)
-                return str(dict and dict.get('name') or None)
+                name = self.context.__name__
+                if name is None:
+                    return 'None'
+                return name
 
         from zope.app.traversing.namespace import provideNamespaceHandler
         from zope.app.traversing.namespace import view
@@ -125,7 +127,7 @@
         page.setSource(
             u'<p tal:replace="template/@@name" />'
             )
-        page = ContextWrapper(page, None, name='zpt')
+        page = contained(page, None, name='zpt')
         request = TestRequest()
         request.setViewType(IBrowserPresentation)
         self.assertEquals(page.render(request), 'zpt\n')




More information about the Zope3-Checkins mailing list