Commit 49ba56b9 authored by Shane Hathaway's avatar Shane Hathaway

- Moved a ZopeSecurityPolicy test from testSecurity to testZopeSecurityPolicy.

- Revert to old Unauthorized exceptions when zExceptions module is not present.
parent 58045017
......@@ -85,8 +85,8 @@
"""Document Template Tests
"""
__rcs_id__='$Id: testSecurity.py,v 1.6 2001/10/17 21:06:17 shane Exp $'
__version__='$Revision: 1.6 $'[11:-2]
__rcs_id__='$Id: testSecurity.py,v 1.7 2001/10/18 20:22:33 shane Exp $'
__version__='$Revision: 1.7 $'[11:-2]
import os, sys, unittest
......@@ -158,14 +158,6 @@ class SecurityTests (DTMLTests):
res = html(c=c)
assert res == '10', res
def testAqNames(self):
from AccessControl.ZopeSecurityPolicy import ZopeSecurityPolicy
policy = ZopeSecurityPolicy()
assert not policy.validate('', '', 'aq_self', '', None)
assert not policy.validate('', '', 'aq_base', '', None)
assert policy.validate('', '', 'aq_parent', '', None)
assert policy.validate('', '', 'aq_explicit', '', None)
# Note: we need more tests!
def test_suite():
......
......@@ -85,13 +85,16 @@
"""Tests of ZopeSecurityPolicy
"""
__rcs_id__='$Id: testZopeSecurityPolicy.py,v 1.1 2001/10/18 20:12:48 shane Exp $'
__version__='$Revision: 1.1 $'[11:-2]
__rcs_id__='$Id: testZopeSecurityPolicy.py,v 1.2 2001/10/18 20:22:33 shane Exp $'
__version__='$Revision: 1.2 $'[11:-2]
import os, sys, unittest
import ZODB
from zExceptions import Unauthorized
try:
from zExceptions import Unauthorized
except ImportError:
Unauthorized = 'Unauthorized'
from AccessControl.ZopeSecurityPolicy import ZopeSecurityPolicy
from AccessControl.User import UserFolder
from AccessControl.SecurityManagement import SecurityContext
......@@ -286,7 +289,12 @@ class ZopeSecurityPolicyTests (unittest.TestCase):
v = self.policy.checkPermission('View', r_item, o_context)
assert v, '_View_Permission should grant access to theowner'
def testAqNames(self):
policy = self.policy
assert not policy.validate('', '', 'aq_self', '', None)
assert not policy.validate('', '', 'aq_base', '', None)
assert policy.validate('', '', 'aq_parent', '', None)
assert policy.validate('', '', 'aq_explicit', '', None)
if 0:
# This test purposely generates a log entry.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment