[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Security/tests - testLoginPassword.py:1.1.2.2 testBasicAuthAdapter.py:1.1.2.3

Guido van Rossum guido@python.org
Thu, 13 Dec 2001 15:45:18 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	testLoginPassword.py testBasicAuthAdapter.py 
Log Message:
Add needLogin(realm) method to ILoginPassword interface and its implementations.

=== Zope3/lib/python/Zope/App/Security/tests/testLoginPassword.py 1.1.2.1 => 1.1.2.2 ===
         self.assertEqual(lp.getLogin(), "tim")
         self.assertEqual(lp.getPassword(), "")
+        lp.needLogin("tim") # This method should exist
 
 def test_suite():
     loader=unittest.TestLoader()


=== Zope3/lib/python/Zope/App/Security/tests/testBasicAuthAdapter.py 1.1.2.2 => 1.1.2.3 ===
     def testUnauthorized(self):
         r = Request(None)
+        a = BasicAuthAdapter(r)
+        a.needLogin("tim")
+        self.assertEqual(r.challenge, "basic realm=tim")
 
 def test_suite():
     loader=unittest.TestLoader()