Commit ac0b28fc authored by Romain Courteaud's avatar Romain Courteaud

Add invoicing_workflow to Hosting Subscription.

parent dfed1964
<workflow_chain> <workflow_chain>
<chain> <chain>
<type>Hosting Subscription</type> <type>Hosting Subscription</type>
<workflow>slapos_accounting_interaction_workflow</workflow> <workflow>slapos_accounting_interaction_workflow, slapos_api_invoicing_workflow</workflow>
</chain> </chain>
<chain> <chain>
<type>Sale Packing List</type> <type>Sale Packing List</type>
......
...@@ -278,3 +278,58 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by D ...@@ -278,3 +278,58 @@ portal_workflow.doActionFor(context, action='edit_action', comment='Visited by D
submit_spl.workflow_history['edit_workflow'][-1]['comment'], submit_spl.workflow_history['edit_workflow'][-1]['comment'],
'Visited by Delivery_calculate') 'Visited by Delivery_calculate')
def test_HostingSubscription_changePromise(self):
new_id = self.generateNewId()
subscription = self.portal.hosting_subscription_module.newContent(
portal_type='Hosting Subscription',
title="Subscription %s" % new_id,
reference="TESTSUB-%s" % new_id,
)
subscription.validate()
self.assertEqual(subscription.getCausalityState(), 'diverged')
request_kw = dict(
software_release='http://example.org',
software_type='http://example.org',
instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(),
shared=False,
)
subscription.converge()
self.assertEqual(subscription.getCausalityState(), 'solved')
subscription.requestStop(**request_kw)
self.assertEqual(subscription.getCausalityState(), 'diverged')
subscription.converge()
self.assertEqual(subscription.getCausalityState(), 'solved')
subscription.requestStart(**request_kw)
self.assertEqual(subscription.getCausalityState(), 'diverged')
subscription.converge()
self.assertEqual(subscription.getCausalityState(), 'solved')
subscription.requestDestroy(**request_kw)
self.assertEqual(subscription.getCausalityState(), 'diverged')
def test_HostingSubscription_changePromiseInDivergedState(self):
new_id = self.generateNewId()
subscription = self.portal.hosting_subscription_module.newContent(
portal_type='Hosting Subscription',
title="Subscription %s" % new_id,
reference="TESTSUB-%s" % new_id,
)
subscription.validate()
self.assertEqual(subscription.getCausalityState(), 'diverged')
request_kw = dict(
software_release='http://example.org',
software_type='http://example.org',
instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(),
shared=False,
)
subscription.requestStop(**request_kw)
self.assertEqual(subscription.getCausalityState(), 'diverged')
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value>
<list>
<string>Base_diverge</string>
</list>
</value>
</item>
<item>
<key> <string>before_commit_script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>HostingSubscription_changePromiseState</string> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<value>
<list>
<string>requestStart</string>
<string>requestStop</string>
<string>requestDestroy</string>
</list>
</value>
</item>
<item>
<key> <string>once_per_transaction</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
66 67
\ No newline at end of file \ No newline at end of file
Hosting Subscription | slapos_accounting_interaction_workflow Hosting Subscription | slapos_accounting_interaction_workflow
Hosting Subscription | slapos_api_invoicing_workflow
Sale Packing List | slapos_accounting_interaction_workflow Sale Packing List | slapos_accounting_interaction_workflow
Slave Instance | slapos_accounting_interaction_workflow Slave Instance | slapos_accounting_interaction_workflow
Slave Instance | slapos_api_invoicing_workflow Slave Instance | slapos_api_invoicing_workflow
......
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