[CMF-checkins] CVS: CMF/CMFCore/tests - test_MembershipTool.py:1.3.2.2
Yvo Schubbe
schubbe@web.de
Mon, 2 Jun 2003 04:44:40 -0400
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv321/CMFCore/tests
Modified Files:
Tag: yuppie-createMemberarea-branch
test_MembershipTool.py
Log Message:
- synched CMFCore with CMFDefault createMemberarea
- removed unused default_member_content
- some whitespace cleanup
=== CMF/CMFCore/tests/test_MembershipTool.py 1.3.2.1 => 1.3.2.2 ===
--- CMF/CMFCore/tests/test_MembershipTool.py:1.3.2.1 Thu May 29 10:39:58 2003
+++ CMF/CMFCore/tests/test_MembershipTool.py Mon Jun 2 04:44:09 2003
@@ -11,6 +11,7 @@
except ImportError:
# for Zope versions before 2.6.0
from Interface import verify_class_implementation as verifyClass
+from AccessControl.SecurityManagement import newSecurityManager
from Products.CMFCore.PortalFolder import PortalFolder
from Products.CMFCore.tests.base.dummy import DummyFolder as DummyFolderBase
@@ -55,8 +56,22 @@
members = self.site._setObject( 'Members', PortalFolder('Members') )
acl_users = self.site._setObject( 'acl_users', DummyUserFolder() )
wtool = self.site._setObject( 'portal_workflow', DummyTool() )
+
+ # permission
+ mtool.createMemberarea('user_foo')
+ self.failIf( hasattr(members.aq_self, 'user_foo') )
+ newSecurityManager(None, acl_users.user_bar)
+ mtool.createMemberarea('user_foo')
+ self.failIf( hasattr(members.aq_self, 'user_foo') )
+ newSecurityManager(None, acl_users.user_foo)
+ mtool.setMemberareaCreationFlag()
+ mtool.createMemberarea('user_foo')
+ self.failIf( hasattr(members.aq_self, 'user_foo') )
+ mtool.setMemberareaCreationFlag()
mtool.createMemberarea('user_foo')
+ self.failUnless( hasattr(members.aq_self, 'user_foo') )
+ # default content
f = members.user_foo
ownership = acl_users.user_foo
localroles = ( ( 'user_foo', ('Owner',) ), )