Commit 58712c56 authored by Shane Hathaway's avatar Shane Hathaway

Added a test that checks access to aq_* names and fixed the implicit access

test.
parent 9372d0d8
......@@ -85,8 +85,8 @@
"""Document Template Tests
"""
__rcs_id__='$Id: testSecurity.py,v 1.5 2001/10/17 20:00:32 tseaver Exp $'
__version__='$Revision: 1.5 $'[11:-2]
__rcs_id__='$Id: testSecurity.py,v 1.6 2001/10/17 21:06:17 shane Exp $'
__version__='$Revision: 1.6 $'[11:-2]
import os, sys, unittest
......@@ -113,7 +113,7 @@ class SecurityTests (DTMLTests):
'<dtml-with person>Hi, my name is '
'<dtml-var name></dtml-with>')
try:
doc(person=person)
doc(person=person())
except Unauthorized:
# Passed the test.
pass
......@@ -158,6 +158,14 @@ 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():
......
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