[Zope-CVS] CVS: Products/PluggableAuthService/tests - test_PluggableAuthService.py:1.3

Zachery Bir zbir at urbanape.com
Mon Aug 2 15:11:29 EDT 2004


Update of /cvs-repository/Products/PluggableAuthService/tests
In directory cvs.zope.org:/tmp/cvs-serv3907/tests

Modified Files:
	test_PluggableAuthService.py 
Log Message:


PluggableAuthService.py

    - Use the emergency user's user name (the special users in
      AccessControl.User don't have user ids).

tests/test_PluggableAuthService.py

    - Test that PAS._findUser() will return the emergency user when presented
      with the emergency user's username.


=== Products/PluggableAuthService/tests/test_PluggableAuthService.py 1.2 => 1.3 ===
--- Products/PluggableAuthService/tests/test_PluggableAuthService.py:1.2	Wed Apr 28 15:58:53 2004
+++ Products/PluggableAuthService/tests/test_PluggableAuthService.py	Mon Aug  2 15:11:29 2004
@@ -791,6 +791,27 @@
 
         self.assertEqual( len( user.listPropertysheets() ), 0 )
 
+    def test__findEmergencyUser_no_plugins( self ):
+
+        from AccessControl.User import UnrestrictedUser
+
+        from Products.PluggableAuthService import PluggableAuthService
+
+        old_eu = PluggableAuthService.emergency_user
+
+        eu = UnrestrictedUser( 'foo', 'bar', ( 'manage', ), () )
+
+        PluggableAuthService.emergency_user = eu
+
+        plugins = self._makePlugins()
+        zcuf = self._makeOne()
+        zcuf._emergency_user = eu
+        user = zcuf._findUser( plugins, 'foo' )
+
+        self.assertEqual( aq_base(zcuf._getEmergencyUser()), aq_base(user) )
+
+        PluggableAuthService.emergency_user = old_eu
+
     def test__findUser_with_userfactory_plugin( self ):
 
         from Products.PluggableAuthService.interfaces.plugins \



More information about the Zope-CVS mailing list