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

Brian Lloyd brian at zope.com
Fri Jan 30 11:59:02 EST 2004


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

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


=== Zope/lib/python/AccessControl/tests/testUserFolder.py 1.5.6.3 => 1.5.6.4 ===
--- Zope/lib/python/AccessControl/tests/testUserFolder.py:1.5.6.3	Wed Jan 28 14:22:28 2004
+++ Zope/lib/python/AccessControl/tests/testUserFolder.py	Fri Jan 30 11:59:01 2004
@@ -135,9 +135,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