Commit 9e0e1162 authored by Roque's avatar Roque

Tests for new software product action

See merge request !18
parents 1226c1c2 a02a5a1b
Pipeline #15782 passed with stage
in 0 seconds
......@@ -129,3 +129,52 @@ class TestOfficeJSScenario(testOfficeJSAppstoreMixin):
t_list.append(self.test_appstore_add_an_application())
for t in t_list:
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,11 +100,13 @@
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<tuple>
<none/>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
......@@ -117,7 +119,9 @@
</item>
</dictionary>
</list>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</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