[Zope-Checkins] CVS: Zope/lib/python/AccessControl/tests - testSecurity.py:1.6
Shane Hathaway
shane@digicool.com
Wed, 17 Oct 2001 17:06:18 -0400
Update of /cvs-repository/Zope/lib/python/AccessControl/tests
In directory cvs.zope.org:/tmp/cvs-serv11920
Modified Files:
testSecurity.py
Log Message:
Added a test that checks access to aq_* names and fixed the implicit access
test.
=== Zope/lib/python/AccessControl/tests/testSecurity.py 1.5 => 1.6 ===
'<dtml-var name></dtml-with>')
try:
- doc(person=person)
+ doc(person=person())
except Unauthorized:
# Passed the test.
pass
@@ -157,6 +157,14 @@
y = 10
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!