[Zope-Checkins] SVN: Zope/trunk/ Forward-port test fix from 2.7 branch.

Tres Seaver tseaver at zope.com
Mon Mar 21 14:44:05 EST 2005


Log message for revision 29626:
  Forward-port test fix from 2.7 branch.

Changed:
  U   Zope/trunk/doc/CHANGES.txt
  U   Zope/trunk/lib/python/OFS/tests/testCopySupport.py

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt	2005-03-21 19:37:05 UTC (rev 29625)
+++ Zope/trunk/doc/CHANGES.txt	2005-03-21 19:44:05 UTC (rev 29626)
@@ -58,6 +58,9 @@
 
     Bugs fixed
  
+      - Forward ported fix for OFS.CopySupport tests which corrected
+        signature of a faux security policy's 'validate' method.
+        
       - 'setup.py' did not install the 'Zope' compatibility module
         (the old 'Zope' package has been renamed to 'Zope2').
 

Modified: Zope/trunk/lib/python/OFS/tests/testCopySupport.py
===================================================================
--- Zope/trunk/lib/python/OFS/tests/testCopySupport.py	2005-03-21 19:37:05 UTC (rev 29625)
+++ Zope/trunk/lib/python/OFS/tests/testCopySupport.py	2005-03-21 19:44:05 UTC (rev 29626)
@@ -281,8 +281,13 @@
         self._lambdas = ( validate_lambda, checkPermission_lambda )
 
     def validate( self, *args, **kw ):
-        return self._lambdas[ 0 ]( *args, **kw )
+        from zExceptions import Unauthorized
 
+        allowed = self._lambdas[ 0 ]( *args, **kw )
+        if not allowed:
+            raise Unauthorized
+        return 1
+
     def checkPermission( self, *args, **kw ) :
         return self._lambdas[ 1 ]( *args, **kw )
 



More information about the Zope-Checkins mailing list