Commit 46ffba6a authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_erp5: Update test for default scenario in order to handle Cloud Contracts

parent b16472dd
......@@ -12,7 +12,6 @@ from AccessControl.SecurityManagement import getSecurityManager, \
setSecurityManager
from DateTime import DateTime
import json
import re
def changeSkin(skin_name):
def decorator(func):
......@@ -353,15 +352,93 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
if q.getTitle() == instance_title]
self.assertEqual(0, len(hosting_subscription_list))
def checkCloudContract(self, person_reference, instance_title,
software_release, software_type, server):
self.stepCallSlaposContractRequestValidationPaymentAlarm()
self.tic()
# stabilise aggregated invoices and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# update invoices with their tax & discount
self.stepCallSlaposTriggerBuildAlarm()
self.tic()
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# update invoices with their tax & discount transaction lines
self.stepCallSlaposTriggerBuildAlarm()
self.tic()
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# stop the invoices and solve them again
self.stepCallSlaposStopConfirmedAggregatedSaleInvoiceTransactionAlarm()
self.tic()
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# build the aggregated payment
self.stepCallSlaposTriggerPaymentTransactionOrderBuilderAlarm()
self.tic()
# start the payzen payment
self.stepCallSlaposPayzenUpdateConfirmedPaymentAlarm()
self.tic()
# stabilise the payment deliveries and expand them
self.stepCallSlaposManageBuildingCalculatingDeliveryAlarm()
self.tic()
# trigger the CRM interaction
self.stepCallSlaposCrmCreateRegularisationRequestAlarm()
self.tic()
# trigger the CRM interaction
self.stepCallSlaposCrmCreateRegularisationRequestAlarm()
self.tic()
self.usePayzenManually(self.web_site, person_reference)
self.tic()
payment = self.portal.portal_catalog.getResultValue(
portal_type="Payment Transaction",
simulation_state="started")
self.logout()
self.login()
data_kw = {
'errorCode': '0',
'transactionStatus': '6',
'authAmount': 200,
'authDevise': '978',
}
payment.PaymentTransaction_createPayzenEvent().PayzenEvent_processUpdate(data_kw, True)
self.login(person_reference)
self.stepCallSlaposContractRequestValidationPaymentAlarm()
self.tic()
def checkInstanceAllocation(self, person_reference, instance_title,
software_release, software_type, server):
self.login(person_reference)
self.personRequestInstanceNotReady(
software_release=software_release,
software_type=software_type,
partition_reference=instance_title,
)
self.checkCloudContract(person_reference, instance_title,
software_release, software_type, server)
self.stepCallSlaposAllocateInstanceAlarm()
self.tic()
......@@ -526,11 +603,11 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
portal_type="Payment Transaction",
simulation_state="started",
).getId()
click_result = \
web_site.accounting_module[document_id].\
web_site.accounting_module[document_id].\
PaymentTransaction_redirectToManualPayzenPayment()
def test(self):
def test_default_scenario(self):
# some preparation
self.logout()
self.web_site = self.portal.web_site_module.hosting
......
......@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testSlapOSERP5DefaultScenario</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSERP5DefaultScenario</string> </value>
......@@ -27,18 +39,13 @@
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple>
<string>F: 8, 0: Unable to import \'testSlapOSCloudSecurityGroup\' (import-error)</string>
</tuple>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 15, 0: Reimport \'re\' (imported line 9) (reimported)</string>
<string>W:529, 4: Unused variable \'click_result\' (unused-variable)</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......@@ -48,13 +55,28 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -67,7 +89,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -76,7 +98,7 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
......
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