Commit dd35e740 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_hr&test: change operators as list and add link field

parent f3ce2cd5
......@@ -9,8 +9,16 @@ if not requester:
requester = context.person_module.newContent(
portal_type='Person',
first_name=first_name,
last_name=last_name,
default_email_coordinate_text=email)
last_name=last_name)
if email and requester.getDefaultEmailCoordinateText() != email:
requester.edit(default_email_coordinate_text = email)
if link:
if not requester.has_key('default_link'):
requester.newContent(portal_type='Link', id='default_link')
if requester.default_link.getUrlString() != link:
requester.default_link.edit(url_string=link)
position_application = context.position_application_module.newContent(
portal_type='Position Application',
......@@ -20,7 +28,7 @@ position_application = context.position_application_module.newContent(
aggregate=position_announcement,
source=source,
source_decision=source_decision,
source_trade=source_trade)
source_trade_list=source_trade_list)
if web_message_date or web_message_text or web_message_title:
if not web_message_date:
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>destination_section=None, email=None, first_name=None, last_name=None, position=None, position_announcement=None,response_template=None,source=None,source_decision=None,source_trade=None,web_message_date=None, web_message_text=None, web_message_title=None,listbox=(),batch=None,**kw</string> </value>
<value> <string>destination_section=None, email=None, first_name=None, last_name=None, link=None, position=None, position_announcement=None,response_template=None,source=None,source_decision=None,source_trade_list=None,web_message_date=None, web_message_text=None, web_message_title=None,listbox=(),batch=None,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -85,7 +85,7 @@
<string>your_position_announcement</string>
<string>your_destination_section</string>
<string>your_source_decision</string>
<string>your_source_trade</string>
<string>your_source_trade_list</string>
<string>your_source</string>
</list>
</value>
......@@ -96,6 +96,7 @@
<list>
<string>your_first_name</string>
<string>your_last_name</string>
<string>your_link</string>
<string>your_email</string>
<string>your_web_message_title</string>
<string>your_web_message_text</string>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_link</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>Too much input was given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>input_type</string> </key>
<value> <string>text</string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Personal link</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -11,14 +11,16 @@
<value>
<list>
<string>items</string>
<string>required</string>
<string>size</string>
<string>title</string>
<string>view_separator</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_source_trade</string> </value>
<value> <string>your_source_trade_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -65,13 +67,23 @@
</value>
</item>
<item>
<key> <string>size</string> </key>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -81,7 +93,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value>
<value> <string>my_multi_list_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......@@ -93,13 +105,25 @@
<list/>
</value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1</int> </value>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Operator</string> </value>
<value> <string>Operators</string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[
<br />
]]></string> </value>
</item>
</dictionary>
</value>
......@@ -120,4 +144,17 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: len(field.get_value(\'items\'))</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -52,11 +52,17 @@ class testPosition(ERP5TypeTestCase):
def test_createSimplePositionApplication(self):
portal = self.getPortalObject()
person_url = portal.person_module.newContent(portal_type='Person').getRelativeUrl()
person_url_2 = portal.person_module.newContent(portal_type='Person').getRelativeUrl()
person_url_3 = portal.person_module.newContent(portal_type='Person').getRelativeUrl()
position = portal.position_module.newContent(portal_type='Position')
position_announcement = portal.position_announcement_module.newContent(portal_type='Position Announcement')
position_application = portal.PositionApplicationModule_addPositionApplication(
position=position.getRelativeUrl(),
position_announcement=position_announcement.getRelativeUrl(),
source_trade_list = [person_url],
source_decision = person_url_2,
source = person_url_3,
first_name='position_test',
last_name='user',
batch=1)
......@@ -64,15 +70,23 @@ class testPosition(ERP5TypeTestCase):
self.assertEqual(position_application.getFollowUpValue(portal_type='Position'), position)
self.assertEqual(position_application.getAggregateValue(portal_type='Position Announcement'), position_announcement)
self.assertEqual(position_application.getSimulationState(), 'suspended')
self.assertEqual(position_application.getSourceTradeList(), [person_url])
self.assertEqual(position_application.getSource(), person_url_3)
self.assertEqual(position_application.getSourceDecision(), person_url_2)
person = position_application.getDestinationDecision()
position_application = portal.PositionApplicationModule_addPositionApplication(
position=position.getRelativeUrl(),
position_announcement=position_announcement.getRelativeUrl(),
first_name='position_test',
last_name='user',
email='xx@info.com',
link='xx',
batch=1)
self.tic()
self.assertEqual(person, position_application.getDestinationDecision())
person = position_application.getDestinationDecisionValue()
self.assertEqual(person.getDefaultEmailCoordinateText(), 'xx@info.com')
self.assertEqual(person.default_link.getUrlString(), 'xx')
def test_createPositionApplicationWithMessage(self):
portal = self.getPortalObject()
......
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