[Zope-Checkins] CVS: Zope/lib/python/AccessControl/tests - testSecurity.py:1.9
Shane Hathaway
shane@cvs.zope.org
Wed, 3 Apr 2002 16:00:20 -0500
Update of /cvs-repository/Zope/lib/python/AccessControl/tests
In directory cvs.zope.org:/tmp/cvs-serv12307/lib/python/AccessControl/tests
Modified Files:
testSecurity.py
Log Message:
Used failUnlessRaises() to clean up a little code.
=== Zope/lib/python/AccessControl/tests/testSecurity.py 1.8 => 1.9 ===
html = self.doc_class('<dtml-var expr="myinst.somemethod()">')
- try:
- html(myinst=myclass())
- except Unauthorized:
- # Passed the test.
- pass
- else:
- assert 0, 'Did not deny attribute access'
+ self.failUnlessRaises(Unauthorized, html, myinst=myclass())
def testSecurityInSyntax(self):
'''