[Zope-Checkins] CVS: Zope/lib/python/AccessControl/tests - testUserFolder.py:1.7.14.2

Brian Lloyd brian at zope.com
Fri Jan 30 11:58:54 EST 2004


Update of /cvs-repository/Zope/lib/python/AccessControl/tests
In directory cvs.zope.org:/tmp/cvs-serv18075/lib/python/AccessControl/tests

Modified Files:
      Tag: Zope-2_7-branch
	testUserFolder.py 
Log Message:
fixed wrong test in testUserFolder


=== Zope/lib/python/AccessControl/tests/testUserFolder.py 1.7.14.1 => 1.7.14.2 ===
--- Zope/lib/python/AccessControl/tests/testUserFolder.py:1.7.14.1	Wed Jan 28 14:39:38 2004
+++ Zope/lib/python/AccessControl/tests/testUserFolder.py	Fri Jan 30 11:58:53 2004
@@ -140,9 +140,16 @@
         user = self.uf.validate(self.app.REQUEST, '', ['role1'])
         self.assertEqual(user, None)
 
-    def testNotValidateWithoutRoles(self):
+    def testValidateWithoutRoles(self):
+        # Note - calling uf.validate without specifying roles will cause
+        # the security machinery to determine the needed roles by looking
+        # at the object itself (or its container). I'm putting this note
+        # in to clarify because the original test expected failure but it
+        # really should have expected success, since the user and the
+        # object being checked both have the role 'role1', even though no
+        # roles are passed explicitly to the userfolder validate method.
         user = self.uf.validate(self.app.REQUEST, self.basic)
-        self.assertEqual(user, None)
+        self.assertEqual(user.getUserName(), 'user1')
 
     def testNotValidateWithEmptyRoles(self):
         user = self.uf.validate(self.app.REQUEST, self.basic, [])




More information about the Zope-Checkins mailing list