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