Commit 62126b88 authored by Gabriel Monnerat's avatar Gabriel Monnerat

- Edit reference of person, this field is the login name of user

- Add dependency

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43940 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b47f8211
......@@ -58,7 +58,9 @@ portal = context.getPortalObject()\n
person = portal.person_module.newContent(portal_type="Person")\n
person.edit(first_name=form.get("firstname"),\n
last_name=form.get("lastname"),\n
password=form.get("password"))\n
email_text=form.get("email"),\n
password=form.get("password"),\n
reference=form.get("login_name"))\n
\n
assignment = person.newContent(portal_type=\'Assignment\')\n
assignment.setFunction("function/ung_user")\n
......
......@@ -83,7 +83,7 @@
<tr><td>First name:</td><td><input type="text" name="firstname"/></td></tr>\n
<tr><td>Last name:</td><td><input type="text" name="lastname"/></td></tr>\n
<tr><td>Email:</td><td><input type="text" name="email"/></td></tr>\n
<tr><td>Login name:</td><td><input type="text" name="login"/></td></tr>\n
<tr><td>Login name:</td><td><input type="text" name="login_name"/></td></tr>\n
<tr><td>Password:</td><td><input type="password" name="password"/></td></tr>\n
<tr><td>Confirm Password:</td><td><input type="password" name="confirm"/></td></tr>\n
<td align="center" colspan="2"><input type="submit" name="logged_in:method" class="submit" value="Create Account"></td>\n
......
......@@ -44,6 +44,7 @@ class TestUNG(ERP5TypeTestCase):
return ('erp5_base',
'erp5_web',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_core_proxy_field_legacy',
'erp5_ingestion',
'erp5_dms',
'erp5_crm',
......@@ -276,11 +277,15 @@ class TestUNG(ERP5TypeTestCase):
"""Test if script creates an user correctly"""
form_dict = dict(firstname="UNG",
lastname="User",
password="ung_password")
email="g@g.com",
password="ung_password",
reference="ung_user")
self.portal.REQUEST.form.update(form_dict)
self.portal.ERPSite_createUNGUser()
self.stepTic()
person = self.portal.portal_catalog.getResultValue(portal_type="Person",
first_name="UNG")
self.assertEquals(person.getLastName(), "User")
self.assertEquals(person.getValidationState(), "validated")
\ No newline at end of file
self.assertEquals(person.getValidationState(), "validated")
self.assertEquals(person.getEmail().getPortalType(), "Email")
self.assertEquals(person.getEmailText(), "g@g.com")
\ No newline at end of file
267
\ No newline at end of file
268
\ No newline at end of file
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