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: ...@@ -9,8 +9,16 @@ if not requester:
requester = context.person_module.newContent( requester = context.person_module.newContent(
portal_type='Person', portal_type='Person',
first_name=first_name, first_name=first_name,
last_name=last_name, last_name=last_name)
default_email_coordinate_text=email)
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( position_application = context.position_application_module.newContent(
portal_type='Position Application', portal_type='Position Application',
...@@ -20,7 +28,7 @@ position_application = context.position_application_module.newContent( ...@@ -20,7 +28,7 @@ position_application = context.position_application_module.newContent(
aggregate=position_announcement, aggregate=position_announcement,
source=source, source=source,
source_decision=source_decision, 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 web_message_date or web_message_text or web_message_title:
if not web_message_date: if not web_message_date:
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <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>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
<string>your_position_announcement</string> <string>your_position_announcement</string>
<string>your_destination_section</string> <string>your_destination_section</string>
<string>your_source_decision</string> <string>your_source_decision</string>
<string>your_source_trade</string> <string>your_source_trade_list</string>
<string>your_source</string> <string>your_source</string>
</list> </list>
</value> </value>
...@@ -96,6 +96,7 @@ ...@@ -96,6 +96,7 @@
<list> <list>
<string>your_first_name</string> <string>your_first_name</string>
<string>your_last_name</string> <string>your_last_name</string>
<string>your_link</string>
<string>your_email</string> <string>your_email</string>
<string>your_web_message_title</string> <string>your_web_message_title</string>
<string>your_web_message_text</string> <string>your_web_message_text</string>
......
...@@ -11,14 +11,16 @@ ...@@ -11,14 +11,16 @@
<value> <value>
<list> <list>
<string>items</string> <string>items</string>
<string>required</string>
<string>size</string> <string>size</string>
<string>title</string> <string>title</string>
<string>view_separator</string>
</list> </list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>your_source_trade</string> </value> <value> <string>your_source_trade_list</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -65,13 +67,23 @@ ...@@ -65,13 +67,23 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>size</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -81,7 +93,7 @@ ...@@ -81,7 +93,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string>my_list_field</string> </value> <value> <string>my_multi_list_field</string> </value>
</item> </item>
<item> <item>
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
...@@ -93,13 +105,25 @@ ...@@ -93,13 +105,25 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>1</int> </value> <value> <int>5</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <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> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -120,4 +144,17 @@ ...@@ -120,4 +144,17 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </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> </ZopeData>
...@@ -52,11 +52,17 @@ class testPosition(ERP5TypeTestCase): ...@@ -52,11 +52,17 @@ class testPosition(ERP5TypeTestCase):
def test_createSimplePositionApplication(self): def test_createSimplePositionApplication(self):
portal = self.getPortalObject() 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 = portal.position_module.newContent(portal_type='Position')
position_announcement = portal.position_announcement_module.newContent(portal_type='Position Announcement') position_announcement = portal.position_announcement_module.newContent(portal_type='Position Announcement')
position_application = portal.PositionApplicationModule_addPositionApplication( position_application = portal.PositionApplicationModule_addPositionApplication(
position=position.getRelativeUrl(), position=position.getRelativeUrl(),
position_announcement=position_announcement.getRelativeUrl(), position_announcement=position_announcement.getRelativeUrl(),
source_trade_list = [person_url],
source_decision = person_url_2,
source = person_url_3,
first_name='position_test', first_name='position_test',
last_name='user', last_name='user',
batch=1) batch=1)
...@@ -64,15 +70,23 @@ class testPosition(ERP5TypeTestCase): ...@@ -64,15 +70,23 @@ class testPosition(ERP5TypeTestCase):
self.assertEqual(position_application.getFollowUpValue(portal_type='Position'), position) self.assertEqual(position_application.getFollowUpValue(portal_type='Position'), position)
self.assertEqual(position_application.getAggregateValue(portal_type='Position Announcement'), position_announcement) self.assertEqual(position_application.getAggregateValue(portal_type='Position Announcement'), position_announcement)
self.assertEqual(position_application.getSimulationState(), 'suspended') 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() person = position_application.getDestinationDecision()
position_application = portal.PositionApplicationModule_addPositionApplication( position_application = portal.PositionApplicationModule_addPositionApplication(
position=position.getRelativeUrl(), position=position.getRelativeUrl(),
position_announcement=position_announcement.getRelativeUrl(), position_announcement=position_announcement.getRelativeUrl(),
first_name='position_test', first_name='position_test',
last_name='user', last_name='user',
email='xx@info.com',
link='xx',
batch=1) batch=1)
self.tic() self.tic()
self.assertEqual(person, position_application.getDestinationDecision()) 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): def test_createPositionApplicationWithMessage(self):
portal = self.getPortalObject() 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