[Checkins] SVN: Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/ Launchpad #300321: ZODBGroupManager.enumerateGroups failed to find groups with unicode IDs.
Tres Seaver
tseaver at palladion.com
Thu Nov 20 10:01:52 EST 2008
Log message for revision 93158:
Launchpad #300321: ZODBGroupManager.enumerateGroups failed to find groups with unicode IDs.
Changed:
U Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/doc/CHANGES.txt
U Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBGroupManager.py
U Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py
-=-
Modified: Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/doc/CHANGES.txt
===================================================================
--- Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/doc/CHANGES.txt 2008-11-20 14:59:58 UTC (rev 93157)
+++ Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/doc/CHANGES.txt 2008-11-20 15:01:52 UTC (rev 93158)
@@ -4,6 +4,9 @@
PluggableAuthService 1.5.4 (Unreleased)
---------------------------------------
+- Launchpad #300321: ZODBGroupManager.enumerateGroups failed to find
+ groups with unicode IDs.
+
- Ensure the _findUser cache is invalidated if the roles or groups for
a principal change.
Modified: Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBGroupManager.py
===================================================================
--- Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBGroupManager.py 2008-11-20 14:59:58 UTC (rev 93157)
+++ Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/ZODBGroupManager.py 2008-11-20 15:01:52 UTC (rev 93158)
@@ -90,10 +90,10 @@
group_ids = []
plugin_id = self.getId()
- if isinstance( id, str ):
+ if isinstance( id, basestring ):
id = [ id ]
- if isinstance( title, str ):
+ if isinstance( title, basestring ):
title = [ title ]
if exact_match and ( id or title ):
Modified: Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py
===================================================================
--- Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py 2008-11-20 14:59:58 UTC (rev 93157)
+++ Products.PluggableAuthService/branches/1.5/Products/PluggableAuthService/plugins/tests/test_ZODBGroupManager.py 2008-11-20 15:01:52 UTC (rev 93158)
@@ -199,6 +199,38 @@
self.assertEqual( zgm.enumerateGroups( id='qux', exact_match=True )
, () )
+ def test_enumerateGroups_exact_string( self ):
+ from Products.PluggableAuthService.tests.test_PluggableAuthService \
+ import FauxRoot
+
+ root = FauxRoot()
+ zgm = self._makeOne(id='exact_nonesuch').__of__(root)
+
+ ID_LIST = ('foo', 'bar', 'baz', 'bam')
+
+ for id in ID_LIST:
+ zgm.addGroup(id, 'Group %s' % id, 'This is group, %s' % id)
+
+ info = zgm.enumerateGroups(id='foo', exact_match=True)
+ self.assertEqual(len(info), 1)
+ self.assertEqual(info[0]['id'], 'foo')
+
+ def test_enumerateGroups_exact_unicode( self ):
+ from Products.PluggableAuthService.tests.test_PluggableAuthService \
+ import FauxRoot
+
+ root = FauxRoot()
+ zgm = self._makeOne(id='exact_nonesuch').__of__(root)
+
+ ID_LIST = ('foo', 'bar', 'baz', 'bam')
+
+ for id in ID_LIST:
+ zgm.addGroup(id, 'Group %s' % id, 'This is group, %s' % id)
+
+ info = zgm.enumerateGroups(id=u'foo', exact_match=True)
+ self.assertEqual(len(info), 1)
+ self.assertEqual(info[0]['id'], 'foo')
+
def test_enumerateGroups_multiple( self ):
from Products.PluggableAuthService.tests.test_PluggableAuthService \
@@ -210,7 +242,6 @@
ID_LIST = ( 'foo', 'bar', 'baz', 'bam' )
for id in ID_LIST:
-
zrm.addGroup( id, 'Group %s' % id, 'This is group, %s' % id )
info_list = zrm.enumerateGroups( id=ID_LIST, exact_match=False )
More information about the Checkins
mailing list