Commit a02a5a1b authored by Roque's avatar Roque

officejs_test: test software product - web site relation

- interaction workflow
- rename leaf domain action
parent 1226c1c2
...@@ -129,3 +129,52 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin): ...@@ -129,3 +129,52 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
t_list.append(self.test_appstore_add_an_application()) t_list.append(self.test_appstore_add_an_application())
for t in t_list: for t in t_list:
self.checkApplicationWithTitle(t) self.checkApplicationWithTitle(t)
def test_software_product_interaction_workflow(self):
'''
setReference interaction workflow ensures the related web site id is the
same as the software product reference
'''
software_product = self.portal.software_product_module.newContent(
portal_type="Software Product",
product_line="software/application",
title="Test Software Product",
description="description",
source_value=self.portal.ERP5Site_getAuthenticatedMemberPersonValue()
)
web_site = software_product.SoftwareProduct_fixRelatedWebSite(batch_mode=True)
self.tic()
#check relation before edit the reference
self.assertTrue(software_product.getReference().startswith("OSP-"))
self.assertEquals(web_site.getId(), software_product.getReference().lower())
self.assertEquals(web_site.getRelativeUrl(), software_product.getFollowUp(portal_type="Web Section"))
#test after editing the reference
new_url = "testapp-" + software_product.getReference()
software_product.edit(reference=new_url)
self.tic()
self.assertEquals(web_site.getId(), new_url.lower())
self.assertEquals(software_product.getReference(), new_url)
self.assertEquals(web_site.getRelativeUrl(), software_product.getFollowUp(portal_type="Web Section"))
def test_software_product_change_app_url_action(self):
software_product = self.portal.software_product_module.newContent(
portal_type="Software Product",
product_line="software/application",
title="Test Software Product",
description="description",
source_value=self.portal.ERP5Site_getAuthenticatedMemberPersonValue()
)
web_site = software_product.SoftwareProduct_fixRelatedWebSite(batch_mode=True)
self.tic()
#check relation before the action
self.assertTrue(software_product.getReference().startswith("OSP-"))
self.assertEquals(web_site.getId(), software_product.getReference().lower())
self.assertEquals(web_site.getRelativeUrl(), software_product.getFollowUp(portal_type="Web Section"))
#test after action
new_url = "testapp-" + software_product.getReference()
software_product.SoftwareProduct_updateApplicationLeafDomain(new_leaf_domain=new_url)
self.tic()
self.assertEquals(web_site.getId(), new_url.lower())
self.assertEquals(software_product.getReference(), new_url)
self.assertEquals(web_site.getRelativeUrl(), software_product.getFollowUp(portal_type="Web Section"))
...@@ -100,24 +100,28 @@ ...@@ -100,24 +100,28 @@
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<list> <key> <string>_log</string> </key>
<dictionary> <value>
<item> <list>
<key> <string>action</string> </key> <dictionary>
<value> <string>validate</string> </value> <item>
</item> <key> <string>action</string> </key>
<item> <value> <string>validate</string> </value>
<key> <string>validation_state</string> </key> </item>
<value> <string>validated</string> </value> <item>
</item> <key> <string>validation_state</string> </key>
</dictionary> <value> <string>validated</string> </value>
</list> </item>
</tuple> </dictionary>
</list>
</value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </ZopeData>
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