Commit 28f07df3 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

erp5_base: create ERP5 Login in create_user_action transition.

parent c22289cf
kwargs = state_change['kwargs'] kwargs = state_change['kwargs']
person = state_change['object'] person = state_change['object']
person.edit(password=kwargs['password'], reference=kwargs['reference']) person.newContent(
portal_type='ERP5 Login',
password=kwargs['password'],
reference=kwargs['reference']).validate()
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>text</string> </key> <key> <string>text</string> </key>
<value> <string>python:not here.getReference()</string> </value> <value> <string>here/hasReference</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -1155,7 +1155,10 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -1155,7 +1155,10 @@ class TestERP5Base(ERP5TypeTestCase):
self.assertTrue(comment in [q['comment'] for q in workflow_history]) self.assertTrue(comment in [q['comment'] for q in workflow_history])
def test_user_creation(self): def test_user_creation(self):
person = self.portal.person_module.newContent(portal_type='Person') person = self.portal.person_module.newContent(
portal_type='Person',
reference='user',
)
assignment = person.newContent(portal_type='Assignment', assignment = person.newContent(portal_type='Assignment',
group='nexedi') group='nexedi')
self.assertNotEquals(None, assignment.getGroupValue()) self.assertNotEquals(None, assignment.getGroupValue())
...@@ -1167,14 +1170,14 @@ class TestERP5Base(ERP5TypeTestCase): ...@@ -1167,14 +1170,14 @@ class TestERP5Base(ERP5TypeTestCase):
self.tic() self.tic()
# a user is created # a user is created
user = self.portal.acl_users.getUserById('user_login') user = self.portal.acl_users.getUserById('user')
self.assertNotEquals(None, user) self.assertNotEquals(None, user)
# and this user has a preference created # and this user has a preference created
newSecurityManager(None, user.__of__(self.portal.acl_users)) newSecurityManager(None, user.__of__(self.portal.acl_users))
self.assertNotEquals(None, self.assertNotEquals(None,
self.portal.portal_catalog.getResultValue(portal_type='Preference', self.portal.portal_catalog.getResultValue(portal_type='Preference',
owner='user_login')) owner='user'))
# for his assignent group # for his assignent group
self.assertEqual('group/nexedi', self.assertEqual('group/nexedi',
self.portal.portal_preferences.getPreferredSectionCategory()) self.portal.portal_preferences.getPreferredSectionCategory())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment