[CMF-checkins] CVS: CMF/CMFDefault/tests - test_join.py:1.7
Florent Guillaume
fg@nuxeo.com
Sat, 29 Jun 2002 11:56:20 -0400
Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv30781/CMFDefault/tests
Modified Files:
test_join.py
Log Message:
Changed CMFDefault.MembershipTool to not create a member folder at
member creation time when the memberareaCreationFlag is false
(Tracker #519).
Note that any code that depended on the member folder being created
after addMember will fail, that code should call createMemberarea
directly if needed.
=== CMF/CMFDefault/tests/test_join.py 1.6 => 1.7 ===
self.root.manage_addProduct[ 'CMFDefault' ].manage_addCMFSite( 'site' )
site = self.root.site
- site.portal_registration.addMember( 'test_user'
+ member_id = 'test_user'
+ site.portal_registration.addMember( member_id
, 'zzyyzz'
- , properties={ 'username':'test_user'
+ , properties={ 'username': member_id
, 'email' : 'foo@bar.com'
}
)
- self.failUnless( site.acl_users.getUser( 'test_user' ) )
- memberfolder = site.Members.test_user
+ u = site.acl_users.getUser(member_id)
+ self.failUnless(u)
+ self.assertRaises(AttributeError,
+ getattr, site.Members, member_id)
+ # test that wrapUser correctly creates member area
+ site.portal_membership.setMemberareaCreationFlag()
+ site.portal_membership.wrapUser(u)
+ memberfolder = getattr(site.Members, member_id)
homepage = memberfolder.index_html
self.assertEqual( memberfolder.Title(), "test_user's Home" )
tool = site.portal_workflow