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

Continue 43bb93dd

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