Commit 719c3361 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

do not use birthday property in Credential Request or Credential Update,...

do not use birthday property in Credential Request or Credential Update, because its storage is start_date and start_date has different meaning in these portal types. add assertions to check if birthday is set by credential request, and not updated unexpectedly by credential update.
parent cfe5ae00
......@@ -10,7 +10,6 @@
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>description</string>
<string>end_datetime</string>
<string>title</string>
......@@ -63,12 +62,6 @@
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
......@@ -76,7 +69,7 @@
<item>
<key> <string>end_datetime</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
......@@ -102,12 +95,6 @@
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>The date of birth for the person.</string> </value>
......@@ -141,19 +128,6 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: here.getDateOfBirth() or here.getBirthday() or None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
......
......@@ -84,7 +84,7 @@ person_mapping = (\n
(\'default_telephone_text\', \'default_telephone_text\'),\n
(\'default_mobile_telephone_text\', \'default_mobile_telephone_text\'),\n
(\'default_email_text\', \'default_email_text\'),\n
(\'start_date\', \'start_date\'),\n
(\'date_of_birth\', \'start_date\'),\n
(\'nationality\', \'nationality\'),\n
(\'skill_list\', \'default_career_skill_list\'),\n
(\'activity_list\', \'default_career_activity_list\'),\n
......
......@@ -61,7 +61,6 @@ person_mapping = (\n
(\'first_name\', \'first_name\'),\n
(\'last_name\', \'last_name\'),\n
(\'gender\', \'gender\'),\n
(\'birthday\', \'birthday\'),\n
(\'date_of_birth\', \'birthday\'),\n
(\'nationality\', \'nationality\'),\n
(\'default_email_text\', \'default_email_text\'),\n
......
......@@ -86,7 +86,6 @@ credential_request = module.newContent(\n
site=site,\n
activity_list=activity_list,\n
corporate_name=corporate_name,\n
birthday=birthday,\n
date_of_birth=date_of_birth)\n
\n
credential_request.setCategoryList(category_list)\n
......@@ -134,7 +133,7 @@ return portal.Base_redirect(form_id=\'login_form\', \n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>reference, default_email_text, first_name=None, last_name=None, password=None, birthday=None, date_of_birth=None, default_telephone_text=None, default_mobile_telephone_text=None, default_fax_text=None, corporate_name=None, default_credential_question_question=None, default_credential_question_question_free_text=None, default_credential_question_answer=None, role_list=None, function=None, site=None, activity_list=None, default_address_city=None, default_address_street_address=None, default_address_zip_code=None,default_address_region=None, dialog_id=\'\', **kw</string> </value>
<value> <string>reference, default_email_text, first_name=None, last_name=None, password=None, date_of_birth=None, default_telephone_text=None, default_mobile_telephone_text=None, default_fax_text=None, corporate_name=None, default_credential_question_question=None, default_credential_question_question_free_text=None, default_credential_question_answer=None, role_list=None, function=None, site=None, activity_list=None, default_address_city=None, default_address_street_address=None, default_address_zip_code=None,default_address_region=None, dialog_id=\'\', **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -79,7 +79,6 @@ else:\n
function=function,\n
activity_list=activity_list,\n
skill_list=skill_list,\n
birthday=birthday,\n
date_of_birth=date_of_birth,\n
destination_decision=person.getRelativeUrl(),\n
default_image_file=default_image_file,\n
......@@ -105,7 +104,7 @@ portal.Base_redirect(keep_items = {\'portal_status_message\': portal_status_mess
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>default_email_text=None, last_name=None, first_name=None, gender=None, nationality=None, password=None, birthday=None, date_of_birth=None, default_telephone_text=None, default_mobile_telephone_text=None, default_fax_text=None, default_credential_question_question=None, default_credential_question_question_free_text=None, default_credential_question_answer=None, function=None, activity_list=None, skill_list=None, default_address_city=None, default_address_street_address=None, default_address_zip_code=None,default_address_region=None,default_image_file=None, description=None, dialog_id=\'\', **kw</string> </value>
<value> <string>default_email_text=None, last_name=None, first_name=None, gender=None, nationality=None, password=None, date_of_birth=None, default_telephone_text=None, default_mobile_telephone_text=None, default_fax_text=None, default_credential_question_question=None, default_credential_question_question_free_text=None, default_credential_question_answer=None, function=None, activity_list=None, skill_list=None, default_address_city=None, default_address_street_address=None, default_address_zip_code=None,default_address_region=None,default_image_file=None, description=None, dialog_id=\'\', **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
2012-07-17 Kazuhiko
* do not use birthday property in Credential Request or Credential Update, because its storage is start_date and start_date has different meaning in these portal types.
2012-04-27 Kazuhiko
* use document_reference in Credential Recovery as the reference of nofitication message if exists.
......
416
\ No newline at end of file
417
\ No newline at end of file
......@@ -31,6 +31,7 @@ from Products.ERP5Type.tests.utils import reindex
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import DummyMailHost
from Products.ERP5Type.tests.Sequence import SequenceList
from DateTime import DateTime
import email, re
from email.header import decode_header, make_header
from email.utils import parseaddr
......@@ -366,6 +367,7 @@ class TestERP5Credential(ERP5TypeTestCase):
last_name='Simpson',
reference=credential_reference,
password='secret',
date_of_birth=DateTime('1970/01/01'),
default_email_text='homer.simpson@fox.com',
role_list=['internal'],
)
......@@ -547,6 +549,7 @@ class TestERP5Credential(ERP5TypeTestCase):
person = person_module.newContent(title='Barney',
reference='barney',
password='secret',
start_date=DateTime('1970/01/01'),
default_email_text='barney@duff.com')
# create an assignment
assignment = person.newContent(portal_type='Assignment',
......@@ -843,6 +846,17 @@ class TestERP5Credential(ERP5TypeTestCase):
def stepLogin(self, sequence):
self.login()
def stepCheckPersonAfterSubscriptionRequest(self, sequence=None,
sequence_list=None, **kw):
self.login()
person = self.portal.portal_catalog.getResultValue(
reference=sequence["person_reference"], portal_type="Person")
self.assertEquals("Homer", person.getFirstName())
self.assertEquals("Simpson", person.getLastName())
self.assertEquals("homer.simpson@fox.com", person.getDefaultEmailText())
self.assertEquals(DateTime('1970/01/01'), person.getStartDate())
self.logout()
def stepSetAuditorRoleToCurrentPerson(self, sequence=None,
sequence_list=None, **kw):
person_reference = sequence["person_reference"]
......@@ -859,6 +873,7 @@ class TestERP5Credential(ERP5TypeTestCase):
self.assertEquals("tom", person.getFirstName())
self.assertEquals("Simpson", person.getLastName())
self.assertEquals("tom@host.com", person.getDefaultEmailText())
self.assertEquals(DateTime('1970/01/01'), person.getStartDate())
def stepCheckPersonWhenCredentialUpdateFail(self, sequence=None,
sequence_list=None, **kw):
......@@ -1202,6 +1217,7 @@ class TestERP5Credential(ERP5TypeTestCase):
sequence_string = "CreateSimpleSubscriptionRequest Tic " \
"SubmitSubscriptionRequest Tic " \
"AcceptSubscriptionRequest Tic " \
"stepCheckPersonAfterSubscriptionRequest " \
"SetAuditorRoleToCurrentPerson " \
"SetAssigneeRoleToCurrentPersonInCredentialUpdateModule Tic " \
"LoginAsCurrentPersonReference " \
......
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