[Checkins] SVN: PluggableAuthService/branches/1.4/ LP #189627: allow unicode args for 'ZODBUserManager.enumerateUsers'.

Tres Seaver tseaver at palladion.com
Wed Feb 6 13:07:36 EST 2008


Log message for revision 83598:
  LP #189627:  allow unicode args for 'ZODBUserManager.enumerateUsers'.

Changed:
  U   PluggableAuthService/branches/1.4/doc/CHANGES.txt
  U   PluggableAuthService/branches/1.4/plugins/ZODBUserManager.py
  U   PluggableAuthService/branches/1.4/plugins/tests/test_ZODBUserManager.py

-=-
Modified: PluggableAuthService/branches/1.4/doc/CHANGES.txt
===================================================================
--- PluggableAuthService/branches/1.4/doc/CHANGES.txt	2008-02-06 14:16:57 UTC (rev 83597)
+++ PluggableAuthService/branches/1.4/doc/CHANGES.txt	2008-02-06 18:07:35 UTC (rev 83598)
@@ -4,6 +4,9 @@
 
     Bugs Fixed
 
+      - ZODBUsers plugin:  fix to allow unicode passed to 'enumerateUsers'.
+        (https://bugs.launchpad.net/zope-pas/+bug/189627)
+
       - DomainAuthHelper plugin:  fix glitch for plugins which have never
         configured any "default" policy:  'authenticateCredentials' and
         'getRolesForPrincipal' would raise ValueError.

Modified: PluggableAuthService/branches/1.4/plugins/ZODBUserManager.py
===================================================================
--- PluggableAuthService/branches/1.4/plugins/ZODBUserManager.py	2008-02-06 14:16:57 UTC (rev 83597)
+++ PluggableAuthService/branches/1.4/plugins/ZODBUserManager.py	2008-02-06 18:07:35 UTC (rev 83598)
@@ -136,10 +136,10 @@
         view_name = createViewName('enumerateUsers', id or login)
 
 
-        if isinstance( id, str ):
+        if isinstance( id, basestring ):
             id = [ id ]
 
-        if isinstance( login, str ):
+        if isinstance( login, basestring ):
             login = [ login ]
 
         # Look in the cache first...

Modified: PluggableAuthService/branches/1.4/plugins/tests/test_ZODBUserManager.py
===================================================================
--- PluggableAuthService/branches/1.4/plugins/tests/test_ZODBUserManager.py	2008-02-06 14:16:57 UTC (rev 83597)
+++ PluggableAuthService/branches/1.4/plugins/tests/test_ZODBUserManager.py	2008-02-06 18:07:35 UTC (rev 83598)
@@ -246,6 +246,24 @@
             self.assertEqual( info_list[ i ][ 'editurl' ]
                             , 'partial/manage_users?user_id=%s' % sorted[ i ])
 
+    def test_enumerateUsers_unicode( self ):
+
+        from Products.PluggableAuthService.tests.test_PluggableAuthService \
+            import FauxRoot
+
+        root = FauxRoot()
+        zum = self._makeOne( id='partial' ).__of__( root )
+
+        ID_LIST = ( 'foo', 'bar', 'baz', 'bam' )
+
+        for id in ID_LIST:
+
+            zum.addUser( id, '%s at example.com' % id, 'password' )
+
+        info_list = zum.enumerateUsers( id = u'abc',
+                                        exact_match=False )
+        self.assertEqual( len( info_list ), 0 )
+
     def test_enumerateUsers_exact_nonesuch( self ):
 
         from Products.PluggableAuthService.tests.test_PluggableAuthService \



More information about the Checkins mailing list