[CMF-checkins] CVS: CMF/CMFCore/tests -
test_MembershipTool.py:1.6.6.2
Yvo Schubbe
schubbe at web.de
Tue Sep 9 10:08:07 EDT 2003
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv15636/CMFCore/tests
Modified Files:
Tag: yuppie-deleteMembers-branch
test_MembershipTool.py
Log Message:
added deleteMemberArea and deleteMembers methods
=== CMF/CMFCore/tests/test_MembershipTool.py 1.6.6.1 => 1.6.6.2 ===
--- CMF/CMFCore/tests/test_MembershipTool.py:1.6.6.1 Tue Sep 9 08:07:23 2003
+++ CMF/CMFCore/tests/test_MembershipTool.py Tue Sep 9 09:08:06 2003
@@ -13,6 +13,7 @@
from Interface import verify_class_implementation as verifyClass
from AccessControl.SecurityManagement import newSecurityManager
+from Products.CMFCore.MemberDataTool import MemberDataTool
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummySite
from Products.CMFCore.tests.base.dummy import DummyTool
@@ -71,6 +72,27 @@
'CMF Collector issue #162 (LocalRoles broken): %s'
% str( f.get_local_roles() ) )
+ def test_deleteMembers(self):
+ mtool = self.mtool
+ members = self.site._setObject( 'Members', PortalFolder('Members') )
+ acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )
+ utool = self.site._setObject( 'portal_url', DummyTool() )
+ wtool = self.site._setObject( 'portal_workflow', DummyTool() )
+ mdtool = self.site._setObject( 'portal_memberdata', MemberDataTool() )
+ newSecurityManager(None, acl_users.all_powerful_Oz)
+
+ self.assertEqual( acl_users.getUserById('user_foo'),
+ acl_users.user_foo )
+ mtool.createMemberArea('user_foo')
+ self.failUnless( hasattr(members.aq_self, 'user_foo') )
+ mdtool.registerMemberData('Dummy', 'user_foo')
+ self.failUnless( mdtool._members.has_key('user_foo') )
+
+ rval = mtool.deleteMembers( ('user_foo', 'user_baz') )
+ self.assertEqual( rval, ('user_foo',) )
+ self.failIf( acl_users.getUserById('user_foo', None) )
+ self.failIf( mdtool._members.has_key('user_foo') )
+ self.failIf( hasattr(members.aq_self, 'user_foo') )
def test_suite():
return TestSuite((
More information about the CMF-checkins
mailing list