Commit 5b81cc0e authored by Jérome Perrin's avatar Jérome Perrin

pdm_ui_test: add missing tests for Organisation's "jump to supply"

parent 0df92b02
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testOrganisationJumpToSupply</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html>
<head><title>Test jump to supplies</title></head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="4">
Test jump to supplies
</td></tr>
</thead>
<tbody tal:define="init_method string:PdmZuite_createDelivery?state=draft">
<tal:block metal:use-macro="here/PdmZuite_CommonTemplate/macros/init" />
<tal:block tal:repeat="supply_portal_type python:('Purchase Supply', 'Sale Supply', 'Internal Supply', )">
<tr>
<td>open</td>
<td>${base_url}/organisation_module/erp5_pdm_ui_test_source_node</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_jump</td>
<td tal:content="supply_portal_type"></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Documents related to Organisation : erp5_pdm_ui_test_source_node_title.</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//span[@class="listbox-current-page-total-number"]</td>
<td>2 records</td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>erp5_pdm_ui_test_supply_1</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>erp5_pdm_ui_test_supply_2</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/organisation_module/erp5_pdm_ui_test_destination_node</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_jump</td>
<td tal:content="supply_portal_type"></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td><tal:block tal:replace="supply_portal_type"/> related to Organisation : erp5_pdm_ui_test_destination_node_title.</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>erp5_pdm_ui_test_supply_1</td>
<td></td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>erp5_pdm_ui_test_supply_2</td>
<td></td>
</tr>
</tal:block>
</tbody></table>
</body>
</html>
\ No newline at end of file
...@@ -46,4 +46,11 @@ for delivery_type in ("Internal", "Purchase", "Sale"): ...@@ -46,4 +46,11 @@ for delivery_type in ("Internal", "Purchase", "Sale"):
stool.manage_delObjects(delivery.getCausalityRelatedIdList(portal_type='Applied Rule')) stool.manage_delObjects(delivery.getCausalityRelatedIdList(portal_type='Applied Rule'))
module.manage_delObjects([delivery_id]) module.manage_delObjects([delivery_id])
# delete supplies
for supply_portal_type in ('Purchase Supply', 'Sale Supply', 'Internal Supply', ):
module = portal.getDefaultModule(supply_portal_type)
for supply_id in ('erp5_pdm_ui_test_supply_1', 'erp5_pdm_ui_test_supply_2', 'erp5_pdm_ui_test_supply_3'):
if getattr(module, supply_id, None) is not None:
module.manage_delObjects([supply_id])
return "Deleted Successfully." return "Deleted Successfully."
...@@ -154,6 +154,28 @@ for node_id, node_title, site_url in ((source_node_id, source_node_title, source ...@@ -154,6 +154,28 @@ for node_id, node_title, site_url in ((source_node_id, source_node_title, source
site=site_url site=site_url
) )
# Create supplies
# for all type of supply, source_node_id has 2 related supplies and destination_node_id has 1
for supply_portal_type in ('Purchase Supply', 'Sale Supply', 'Internal Supply', ):
module = portal.getDefaultModule(supply_portal_type)
module.newContent(
portal_type=supply_portal_type,
id='erp5_pdm_ui_test_supply_1',
source_value=portal.organisation_module[source_node_id],
destination_value=portal.organisation_module[destination_node_id],
)
module.newContent(
portal_type=supply_portal_type,
id='erp5_pdm_ui_test_supply_2',
source_section_value=portal.organisation_module[source_node_id],
)
# an unrelated supply that should not be displayed
module.newContent(
portal_type=supply_portal_type,
id='erp5_pdm_ui_test_supply_3',
)
# Reset selections # Reset selections
stool = context.getPortalObject().portal_selections stool = context.getPortalObject().portal_selections
stool.setSelectionFor('resource_current_inventory', None) stool.setSelectionFor('resource_current_inventory', None)
......
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