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

pdm_ui_test: tests of jump from resource to transformation

parent 2b776041
<?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>testResourceJumpToTransformation</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>Resource Jump to Transformation</unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html>
<head><title tal:content="template/title"></title></head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="4" tal:content="template/title"></td></tr>
</thead>
<tbody tal:define="init_method string:ERP5Site_createTransformationForPdmUiTest">
<tal:block metal:use-macro="here/PdmZuite_CommonTemplate/macros/init" />
<tal:block tal:repeat="resource_relative_url python: (
'product_module/erp5_pdm_ui_test_product_without_transformation',
'component_module/erp5_pdm_ui_test_component_without_transformation',)">
<tr>
<td>open</td>
<td>${base_url}/<tal:block tal:replace="resource_relative_url"/></td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_jump</td>
<td>Related Transformation</td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>No Transformation related.</td>
<td></td>
</tr>
</tal:block>
<tr>
<td>open</td>
<td>${base_url}/product_module/erp5_pdm_ui_test_product_with_one_transformation</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_jump</td>
<td>Related Transformation</td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Transformation related to Product : erp5_pdm_ui_test_product_with_one_transformation.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/component_module/erp5_pdm_ui_test_component_with_one_transformation</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_jump</td>
<td>Related Transformation</td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Transformation related to Component : erp5_pdm_ui_test_component_with_one_transformation.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/product_module/erp5_pdm_ui_test_product_with_two_transformations</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_jump</td>
<td>Related Transformation</td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Documents related to Product : erp5_pdm_ui_test_product_with_two_transformations.</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_transformation_1</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/component_module/erp5_pdm_ui_test_component_with_two_transformations</td>
<td></td>
</tr>
<tr>
<td>selectAndWait</td>
<td>select_jump</td>
<td>Related Transformation</td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Documents related to Component : erp5_pdm_ui_test_component_with_two_transformations.</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_transformation_1</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
portal = context.getPortalObject()
# Create resources and transformations.
for product_id in (
'erp5_pdm_ui_test_product_with_one_transformation',
'erp5_pdm_ui_test_product_with_two_transformations',
'erp5_pdm_ui_test_product_without_transformation',
):
if getattr(portal.product_module, product_id, None) is None:
portal.product_module.newContent(id=product_id, portal_type='Product')
for component_id in (
'erp5_pdm_ui_test_component_with_one_transformation',
'erp5_pdm_ui_test_component_with_two_transformations',
'erp5_pdm_ui_test_component_without_transformation',
):
if getattr(portal.component_module, component_id, None) is None:
portal.component_module.newContent(id=component_id, portal_type='Component')
erp5_pdm_ui_test_transformation_1 = portal.transformation_module.newContent(
portal_type='Transformation',
id='erp5_pdm_ui_test_transformation_1',
resource_value=portal.product_module.erp5_pdm_ui_test_product_with_two_transformations,
)
erp5_pdm_ui_test_transformation_1.newContent(
portal_type='Transformation Transformed Resource',
resource_value=portal.product_module.erp5_pdm_ui_test_product_with_one_transformation,
)
erp5_pdm_ui_test_transformation_1.newContent(
portal_type='Transformation Transformed Resource',
resource_value=portal.component_module.erp5_pdm_ui_test_component_with_one_transformation,
)
erp5_pdm_ui_test_transformation_1.newContent(
portal_type='Transformation Transformed Resource',
resource_value=portal.component_module.erp5_pdm_ui_test_component_with_two_transformations,
)
erp5_pdm_ui_test_transformation_2 = portal.transformation_module.newContent(
portal_type='Transformation',
id='erp5_pdm_ui_test_transformation_2',
resource_value=portal.component_module.erp5_pdm_ui_test_component_with_two_transformations,
)
erp5_pdm_ui_test_transformation_2.newContent(
portal_type='Transformation Transformed Resource',
resource_value=portal.product_module.erp5_pdm_ui_test_product_with_two_transformations,
)
portal.transformation_module.newContent(
portal_type='Transformation',
id='erp5_pdm_ui_test_transformation_3',
)
return "Delivery Created."
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<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_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_createTransformationForPdmUiTest</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -10,10 +10,20 @@ destination_site_id = "erp5_pdm_ui_test_destination_site" ...@@ -10,10 +10,20 @@ destination_site_id = "erp5_pdm_ui_test_destination_site"
delivery_id = "erp5_pdm_ui_test_delivery" delivery_id = "erp5_pdm_ui_test_delivery"
# Delete resources # Delete resources
if getattr(portal.product_module, 'erp5_pdm_ui_test_product', None) is not None: for product_id in (
portal.product_module.manage_delObjects(['erp5_pdm_ui_test_product']) 'erp5_pdm_ui_test_product',
if getattr(portal.component_module, 'erp5_pdm_ui_test_component', None) is not None: 'erp5_pdm_ui_test_product_with_two_transformations',
portal.component_module.manage_delObjects(['erp5_pdm_ui_test_component']) 'erp5_pdm_ui_test_product_without_transformation',
):
if getattr(portal.product_module, product_id, None) is not None:
portal.product_module.manage_delObjects([product_id])
for component_id in (
'erp5_pdm_ui_test_component',
'erp5_pdm_ui_test_component_with_two_transformations',
'erp5_pdm_ui_test_component_without_transformation',
):
if getattr(portal.component_module, component_id, None) is not None:
portal.component_module.manage_delObjects([component_id])
# Delete nodes # Delete nodes
module = portal.getDefaultModule(node_portal_type) module = portal.getDefaultModule(node_portal_type)
...@@ -53,4 +63,13 @@ for supply_portal_type in ('Purchase Supply', 'Sale Supply', 'Internal Supply', ...@@ -53,4 +63,13 @@ for supply_portal_type in ('Purchase Supply', 'Sale Supply', 'Internal Supply',
if getattr(module, supply_id, None) is not None: if getattr(module, supply_id, None) is not None:
module.manage_delObjects([supply_id]) module.manage_delObjects([supply_id])
for transformation_id in (
'erp5_pdm_ui_test_transformation_1',
'erp5_pdm_ui_test_transformation_2',
'erp5_pdm_ui_test_transformation_3',
):
if getattr(portal.transformation_module, transformation_id, None) is not None:
portal.transformation_module.manage_delObjects([transformation_id])
return "Deleted Successfully." return "Deleted Successfully."
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