[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Security/Registries/tests - testPrincipalRegistry.py:1.2

Itamar Shtull-Trauring zope@itamarst.org
Fri, 6 Dec 2002 08:12:40 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Security/Registries/tests
In directory cvs.zope.org:/tmp/cvs-serv5098/App/Security/Registries/tests

Modified Files:
	testPrincipalRegistry.py 
Log Message:
update IAuthenticateService for requirements of generic implementation

=== Zope3/lib/python/Zope/App/Security/Registries/tests/testPrincipalRegistry.py 1.1 => 1.2 ===
--- Zope3/lib/python/Zope/App/Security/Registries/tests/testPrincipalRegistry.py:1.1	Thu Jun 20 11:55:02 2002
+++ Zope3/lib/python/Zope/App/Security/Registries/tests/testPrincipalRegistry.py	Fri Dec  6 08:12:09 2002
@@ -104,14 +104,14 @@
 
     def testAuthenticate(self):
         req = Request(('tim', '123'))
-        pid = self.reg.authenticate(req)
+        pid = self.reg.authenticate(req).getId()
         self.assertEquals(pid, '1')
         req = Request(('tim', '1234'))
-        pid = self.reg.authenticate(req)
-        self.assertEquals(pid, None)
+        p = self.reg.authenticate(req)
+        self.assertEquals(p, None)
         req = Request(('kim', '123'))
-        pid = self.reg.authenticate(req)
-        self.assertEquals(pid, None)
+        p = self.reg.authenticate(req)
+        self.assertEquals(p, None)
 
     def testUnauthorized(self):
         request = Request(None)
@@ -129,10 +129,10 @@
         self.assertRaises(DuplicateId, self.reg.defineDefaultPrincipal,
                           "1", "tim")
         self.reg.defineDefaultPrincipal("everybody", "Default Principal")
-        self.assertEquals(self.reg.unauthenticatedPrincipal(), "everybody")
+        self.assertEquals(self.reg.unauthenticatedPrincipal().getId(), "everybody")
         self.reg.defineDefaultPrincipal("anybody", "Default Principal",
                                         "This is the default headmaster")
-        self.assertEquals(self.reg.unauthenticatedPrincipal(), "anybody")
+        self.assertEquals(self.reg.unauthenticatedPrincipal().getId(), "anybody")
         self.assertRaises(NotFoundError, self.reg.getPrincipal, "everybody")
         p = self.reg.getPrincipal("anybody")
         self.assertEquals(p.getId(), "anybody")