CVS: Products/PluggableAuthService/tests - test_PluggableAuthService.py:1.18
Zachery Bir <[email protected]>
| Newsgroups | gmane.comp.web.zope.public-cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs-repository/Products/PluggableAuthService/tests
In directory cvs.zope.org:/tmp/cvs-serv19919/tests
Modified Files:
test_PluggableAuthService.py
Log Message:
applied Mark Hammond's patch
=== Products/PluggableAuthService/tests/test_PluggableAuthService.py 1.17 => 1.18 ===
--- Products/PluggableAuthService/tests/test_PluggableAuthService.py:1.17 Fri May 27 14:55:45 2005
+++ Products/PluggableAuthService/tests/test_PluggableAuthService.py Fri May 27 15:10:45 2005
@@ -1209,6 +1209,28 @@
user = zcuf.getUser( '[email protected]' )
self.assertEqual( user.getId(), 'bar+bar' )
+ def test_getUser_id_and_name( self ):
+ # Tests fetching a user by ID versus fetching by username.
+ from Products.PluggableAuthService.interfaces.plugins \
+ import IUserEnumerationPlugin
+
+ plugins = self._makePlugins()
+ zcuf = self._makeOne( plugins )
+
+ bar = self._makeUserEnumerator( 'bar', '[email protected]' )
+ bar.identifier = 'bar/'
+ zcuf._setObject( 'bar', bar )
+
+ zcuf.plugins.activatePlugin(IUserEnumerationPlugin, 'bar')
+ # Fetch the new user by ID and name, and check we get the same.
+ user = zcuf.getUserById('bar/bar')
+ self.assertEqual( user.getId(), 'bar/bar')
+ self.assertEqual( user.getUserName(), '[email protected]' )
+
+ user2 = zcuf.getUser('[email protected]')
+ self.assertEqual( user2.getId(), 'bar/bar')
+ self.assertEqual( user2.getUserName(), '[email protected]' )
+
def test_simple_getUserGroups_with_Groupplugin(self):
from Products.PluggableAuthService.interfaces.plugins \
_______________________________________________
Zope-CVS maillist - [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs
Zope CVS instructions: http://dev.zope.org/CVS