Commit ce453497 authored by Łukasz Nowak's avatar Łukasz Nowak

Continue 43bb93dd

More things were destroyed in 7cec0b75
parent 34992293
......@@ -53,6 +53,7 @@
<value> <string>person = context.getDestinationSectionValue()\n
if person is not None:\n
person.Person_storeOpenSaleOrderJournal()\n
context.converge()\n
</string> </value>
</item>
<item>
......
......@@ -666,50 +666,10 @@ class TestOpenSaleOrderAlarm(testSlapOSMixin):
for q in open_sale_order_template.getCategoryList()]))
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_validated(self):
def test_alarm_HS_diverged(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'validated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_validated_OSO_invalidated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'validated')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'invalidated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_archived(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'archived')
self.tic()
self.portal.portal_alarms\
......@@ -720,75 +680,6 @@ class TestOpenSaleOrderAlarm(testSlapOSMixin):
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_archived_OSO_validated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'archived')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'validated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_validated_OSO_validated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'validated')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'validated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertNotEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
@simulateHostingSubscription_requestUpdateOpenSaleOrder
def test_alarm_HS_archived_OSO_invalidated(self):
subscription = self.portal.hosting_subscription_module\
.template_hosting_subscription.Base_createCloneDocument(batch_mode=1)
subscription.edit(reference='TESTHS-%s' % self.generateNewId())
self.portal.portal_workflow._jumpToStateFor(subscription, 'archived')
open_sale_order = self.portal.open_sale_order_module\
.template_open_sale_order.Base_createCloneDocument(batch_mode=1)
open_sale_order.edit(reference='TESTOSO-%s' % self.generateNewId())
open_sale_order.newContent(portal_type='Open Sale Order Line',
aggregate=subscription.getRelativeUrl())
self.portal.portal_workflow._jumpToStateFor(open_sale_order, 'invalidated')
self.tic()
self.portal.portal_alarms\
.slapos_request_update_hosting_subscription_open_sale_order\
.activeSense()
self.tic()
self.assertNotEqual(
'Visited by HostingSubscription_requestUpdateOpenSaleOrder',
subscription.workflow_history['edit_workflow'][-1]['comment'])
class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
def test_empty_HostingSubscription(self):
person = self.portal.person_module.template_member\
......@@ -803,6 +694,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order',
......@@ -856,6 +748,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order',
......@@ -903,10 +796,12 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
'time': destroy_time,
'action': 'request_destroy'
})
subscription.diverge()
self.tic()
subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order',
......@@ -984,6 +879,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
subscription.HostingSubscription_requestUpdateOpenSaleOrder()
self.tic()
self.assertEqual(subscription.getCausalityState(), 'solved')
open_sale_order_list = self.portal.portal_catalog(
portal_type='Open Sale Order',
......
102
\ No newline at end of file
103
\ 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