[Zope3-checkins] CVS: Zope3/src/zope/app/browser/exception/tests - test_unauthorized.py:1.10

Jim Fulton jim at zope.com
Sun Sep 21 13:30:34 EDT 2003


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

Modified Files:
	test_unauthorized.py 
Log Message:
No longer need context wrappers methods.

Use contained helper function to set up a containment relationship.


=== Zope3/src/zope/app/browser/exception/tests/test_unauthorized.py 1.9 => 1.10 ===
--- Zope3/src/zope/app/browser/exception/tests/test_unauthorized.py:1.9	Tue Aug 12 15:14:56 2003
+++ Zope3/src/zope/app/browser/exception/tests/test_unauthorized.py	Sun Sep 21 13:30:34 2003
@@ -19,11 +19,11 @@
 
 from unittest import TestCase, main, makeSuite
 from zope.publisher.browser import TestRequest
-from zope.app.context import ContextWrapper
 from zope.app.interfaces.security import IAuthenticationService, IPrincipal
+from zope.app.container.contained import contained
 from zope.interface import implements
 from zope.app.browser.exception.unauthorized import Unauthorized
-
+from zope.app.event.tests.placelesssetup import PlacelessSetup
 
 class Unauthorized(Unauthorized):
     """Unusually done by ZCML."""
@@ -52,7 +52,7 @@
 class DummyPrincipalSource:
     pass
 
-class Test(TestCase):
+class Test(TestCase, PlacelessSetup):
 
     def test(self):
         exception = Exception()
@@ -62,7 +62,7 @@
             pass
         request = TestRequest('/')
         authservice = DummyAuthService()
-        request.setUser(ContextWrapper(DummyPrincipal(23), authservice))
+        request.setUser(contained(DummyPrincipal(23), authservice))
         u = Unauthorized(exception, request)
         u.issueChallenge()
 
@@ -82,8 +82,8 @@
         request = TestRequest('/')
         authservice = DummyAuthService()
         psrc = DummyPrincipalSource()
-        psrc = ContextWrapper(psrc, authservice)
-        request.setUser(ContextWrapper(DummyPrincipal(23), psrc))
+        psrc = contained(psrc, authservice)
+        request.setUser(contained(DummyPrincipal(23), psrc))
         u = Unauthorized(exception, request)
         u.issueChallenge()
 




More information about the Zope3-Checkins mailing list