Commit 903bcc6f authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Added Test for Subscription Request Alarms & Skins

  It incldudes minor fixes on the scripts
parent a406368d
...@@ -6,7 +6,7 @@ person = context.getDestinationSectionValue() ...@@ -6,7 +6,7 @@ person = context.getDestinationSectionValue()
if person is None: if person is None:
return return
if context.getSimulationState() == "validated": if context.getSimulationState() == "confirmed":
return return
request_kw = {} request_kw = {}
......
...@@ -5,6 +5,7 @@ if REQUEST is not None: ...@@ -5,6 +5,7 @@ if REQUEST is not None:
portal = context.getPortalObject() portal = context.getPortalObject()
current_invoice = context.getCausalityValue() current_invoice = context.getCausalityValue()
current_payment = None
if current_invoice is None: if current_invoice is None:
......
# Copyright (c) 2013 Nexedi SA and Contributors. All Rights Reserved.
from erp5.component.test.SlapOSTestCaseMixin import \
SlapOSTestCaseMixin
class TestSlapOSSubscriptionRequestProcessDraft(SlapOSTestCaseMixin):
def test_alarm_slapos_subscription_request_process_draft(self):
script_name = "SubscriptionRequest_verifyPaymentTransaction"
alarm = self.portal.portal_alarms.slapos_subscription_request_process_draft
subscription_request = self.portal.subscription_request_module.newContent(
portal_type='Subscription Request',
title="Test Subscription Request %s" % self.new_id,
reference="TESTSUBSCRIPTIONREQUEST-%s" % self.new_id
)
self._test_alarm(
alarm, subscription_request, script_name)
def test_alarm_slapos_subscription_request_process_planned(self):
script_name = "SubscriptionRequest_boostrapUserAccount"
alarm = self.portal.portal_alarms.slapos_subscription_request_process_planned
subscription_request = self.portal.subscription_request_module.newContent(
portal_type='Subscription Request',
title="Test Subscription Request %s" % self.new_id,
reference="TESTSUBSCRIPTIONREQUEST-%s" % self.new_id
)
subscription_request.planned()
self._test_alarm(
alarm, subscription_request, script_name)
def test_alarm_slapos_subscription_request_process_ordered(self):
script_name = "SubscriptionRequest_checkPaymentBalance"
alarm = self.portal.portal_alarms.slapos_subscription_request_process_ordered
subscription_request = self.portal.subscription_request_module.newContent(
portal_type='Subscription Request',
title="Test Subscription Request %s" % self.new_id,
reference="TESTSUBSCRIPTIONREQUEST-%s" % self.new_id
)
subscription_request.planned()
subscription_request.ordered()
self._test_alarm(
alarm, subscription_request, script_name)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</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>testSlapOSSubscriptionAlarm</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSSubscriptionAlarm</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<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>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</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>testSlapOSSubscriptionSkins</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSSubscriptionSkins</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:255, 4: Unused variable \'email\' (unused-variable)</string>
<string>W:256, 4: Unused variable \'name\' (unused-variable)</string>
<string>W:267, 4: Unused variable \'name\' (unused-variable)</string>
<string>W:276, 4: Unused variable \'name\' (unused-variable)</string>
</tuple>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<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>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
test.erp5.testSlapOSTrialSkins test.erp5.testSlapOSTrialSkins
test.erp5.testSlapOSTrialAlarm test.erp5.testSlapOSTrialAlarm
\ No newline at end of file test.erp5.testSlapOSSubscriptionAlarm
test.erp5.testSlapOSSubscriptionSkins
\ No newline at end of file
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