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, \ ...@@ -12,7 +12,6 @@ from AccessControl.SecurityManagement import getSecurityManager, \
setSecurityManager setSecurityManager
from DateTime import DateTime from DateTime import DateTime
import json import json
import re
def changeSkin(skin_name): def changeSkin(skin_name):
def decorator(func): def decorator(func):
...@@ -353,16 +352,94 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin): ...@@ -353,16 +352,94 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
if q.getTitle() == instance_title] if q.getTitle() == instance_title]
self.assertEqual(0, len(hosting_subscription_list)) 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, def checkInstanceAllocation(self, person_reference, instance_title,
software_release, software_type, server): software_release, software_type, server):
self.login(person_reference) self.login(person_reference)
self.personRequestInstanceNotReady( self.personRequestInstanceNotReady(
software_release=software_release, software_release=software_release,
software_type=software_type, software_type=software_type,
partition_reference=instance_title, partition_reference=instance_title,
) )
self.checkCloudContract(person_reference, instance_title,
software_release, software_type, server)
self.stepCallSlaposAllocateInstanceAlarm() self.stepCallSlaposAllocateInstanceAlarm()
self.tic() self.tic()
...@@ -526,11 +603,11 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin): ...@@ -526,11 +603,11 @@ class TestSlapOSDefaultScenario(TestSlapOSSecurityMixin):
portal_type="Payment Transaction", portal_type="Payment Transaction",
simulation_state="started", simulation_state="started",
).getId() ).getId()
click_result = \
web_site.accounting_module[document_id].\ web_site.accounting_module[document_id].\
PaymentTransaction_redirectToManualPayzenPayment() PaymentTransaction_redirectToManualPayzenPayment()
def test(self): def test_default_scenario(self):
# some preparation # some preparation
self.logout() self.logout()
self.web_site = self.portal.web_site_module.hosting self.web_site = self.portal.web_site_module.hosting
......
...@@ -6,10 +6,22 @@ ...@@ -6,10 +6,22 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testSlapOSERP5DefaultScenario</string> </value> <value> <string>testSlapOSERP5DefaultScenario</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSERP5DefaultScenario</string> </value> <value> <string>test.erp5.testSlapOSERP5DefaultScenario</string> </value>
...@@ -27,18 +39,13 @@ ...@@ -27,18 +39,13 @@
<item> <item>
<key> <string>text_content_error_message</string> </key> <key> <string>text_content_error_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>F: 8, 0: Unable to import \'testSlapOSCloudSecurityGroup\' (import-error)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 15, 0: Reimport \'re\' (imported line 9) (reimported)</string>
<string>W:529, 4: Unused variable \'click_result\' (unused-variable)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -48,13 +55,28 @@ ...@@ -48,13 +55,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <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> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -67,7 +89,7 @@ ...@@ -67,7 +89,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -76,7 +98,7 @@ ...@@ -76,7 +98,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </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