[Zope3-checkins] CVS: Zope3/src/zope/app/component/tests - test_directives.py:1.15

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


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

Modified Files:
	test_directives.py 
Log Message:
Changed the way permissions are handled. Now just create a checker to
be used later when the component is proxied. Don't proxy the component
right away.


=== Zope3/src/zope/app/component/tests/test_directives.py 1.14 => 1.15 ===
--- Zope3/src/zope/app/component/tests/test_directives.py:1.14	Sun Aug  3 13:50:15 2003
+++ Zope3/src/zope/app/component/tests/test_directives.py	Sun Sep 21 13:31:25 2003
@@ -35,6 +35,7 @@
 from zope.component.tests.views import IV, IC, V1, VZMI, R1, RZMI
 from zope.component.tests.request import Request
 from zope.interface import implements
+from zope.security.checker import ProxyFactory
 
 
 template = """<configure
@@ -121,7 +122,7 @@
             """
             )))
 
-        adapter = getAdapter(Content(), IApp)
+        adapter = ProxyFactory(getAdapter(Content(), IApp))
         items = [item[0] for item in getTestProxyItems(adapter)]
         self.assertEqual(items, ['a', 'f'])
         self.assertEqual(getProxiedObject(adapter).__class__, Comp)
@@ -214,7 +215,7 @@
             """
             )))
 
-        utility = getUtility(None, IApp)
+        utility = ProxyFactory(getUtility(None, IApp))
         items = [item[0] for item in getTestProxyItems(utility)]
         self.assertEqual(items, ['a', 'f'])
         self.assertEqual(getProxiedObject(utility), comp)
@@ -263,7 +264,7 @@
             """
             ))
 
-        v = getView(Ob(), 'test', Request(IV))
+        v = ProxyFactory(getView(Ob(), 'test', Request(IV)))
         self.assertEqual(v.index(), 'V1 here')
         self.assertRaises(Exception, getattr, v, 'action')
 
@@ -280,7 +281,7 @@
             """
             ))
 
-        v = getView(Ob(), 'test', Request(IV))
+        v = ProxyFactory(getView(Ob(), 'test', Request(IV)))
         self.assertEqual(v.action(), 'done')
         self.assertRaises(Exception, getattr, v, 'index')
 




More information about the Zope3-Checkins mailing list