Commit 80002b53 authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: rebase fixup

parent 53b7fe18
...@@ -549,7 +549,6 @@ class TestSlapOSUpdateOpenSaleOrderPeriod(SlapOSTestCaseMixin): ...@@ -549,7 +549,6 @@ class TestSlapOSUpdateOpenSaleOrderPeriod(SlapOSTestCaseMixin):
open_order = self.createOpenOrder() open_order = self.createOpenOrder()
open_order.OpenSaleOrder_updatePeriod() open_order.OpenSaleOrder_updatePeriod()
@simulateByEditWorkflowMark('Person_storeOpenSaleOrderJournal')
def test_updatePeriod_validated(self): def test_updatePeriod_validated(self):
open_order = self.createOpenOrder() open_order = self.createOpenOrder()
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
...@@ -560,9 +559,9 @@ class TestSlapOSUpdateOpenSaleOrderPeriod(SlapOSTestCaseMixin): ...@@ -560,9 +559,9 @@ class TestSlapOSUpdateOpenSaleOrderPeriod(SlapOSTestCaseMixin):
open_order.newContent( open_order.newContent(
portal_type="Open Sale Order Line" portal_type="Open Sale Order Line"
) )
self.assertRaises(AssertionError, open_order.OpenSaleOrder_updatePeriod) self.assertRaises(AssertionError, open_order.OpenSaleOrder_updatePeriod)
@simulateByEditWorkflowMark('Person_storeOpenSaleOrderJournal')
def test_updatePeriod_invalidated(self): def test_updatePeriod_invalidated(self):
open_order = self.createOpenOrder() open_order = self.createOpenOrder()
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
...@@ -570,14 +569,11 @@ class TestSlapOSUpdateOpenSaleOrderPeriod(SlapOSTestCaseMixin): ...@@ -570,14 +569,11 @@ class TestSlapOSUpdateOpenSaleOrderPeriod(SlapOSTestCaseMixin):
open_order.edit( open_order.edit(
destination_decision_value=person, destination_decision_value=person,
) )
open_order.invalidate()
open_order.newContent( open_order.newContent(
portal_type="Open Sale Order Line" portal_type="Open Sale Order Line"
) )
open_order.invalidate()
open_order.OpenSaleOrder_updatePeriod() open_order.OpenSaleOrder_updatePeriod()
self.assertNotEqual(
'Visited by Person_storeOpenSaleOrderJournal',
person.workflow_history['edit_workflow'][-1]['comment'])
def test_alarm(self): def test_alarm(self):
open_order = self.createOpenOrder() open_order = self.createOpenOrder()
...@@ -624,7 +620,7 @@ class TestSlapOSReindexOpenSaleOrder(SlapOSTestCaseMixin): ...@@ -624,7 +620,7 @@ class TestSlapOSReindexOpenSaleOrder(SlapOSTestCaseMixin):
self.tic() self.tic()
# Jut wait a bit so the line has a different timestamp > 1 sec. # Jut wait a bit so the line has a different timestamp > 1 sec.
time.sleep(1) time.sleep(1)
open_order_line = open_order.newContent(portal_type="Open Sale Order Line") open_order.newContent(portal_type="Open Sale Order Line")
self.tic() self.tic()
script_name = "OpenSaleOrder_reindexIfIndexedBeforeLine" script_name = "OpenSaleOrder_reindexIfIndexedBeforeLine"
alarm = self.portal.portal_alarms.slapos_reindex_open_sale_order alarm = self.portal.portal_alarms.slapos_reindex_open_sale_order
...@@ -635,13 +631,11 @@ class TestSlapOSReindexOpenSaleOrder(SlapOSTestCaseMixin): ...@@ -635,13 +631,11 @@ class TestSlapOSReindexOpenSaleOrder(SlapOSTestCaseMixin):
def test_alarm_no_line(self): def test_alarm_no_line(self):
open_order = self.createOpenOrder() open_order = self.createOpenOrder()
self.tic() self.tic()
# Rather them test the alarm with fake script, directly script_name = "OpenSaleOrder_reindexIfIndexedBeforeLine"
# test the ERP5Site_zGetOpenOrderWithModifiedLineUid code. alarm = self.portal.portal_alarms.slapos_reindex_open_sale_order
open_order_with_modified_line_uid_list = [i.uid for i in \
self.portal.ERP5Site_zGetOpenOrderWithModifiedLineUid()]
self.assertNotIn(open_order.getUid(), open_order_with_modified_line_uid_list)
self._test_alarm_not_visited(
alarm, open_order, script_name)
class TestSlapOSGeneratePackingListFromTioXML(SlapOSTestCaseMixin): class TestSlapOSGeneratePackingListFromTioXML(SlapOSTestCaseMixin):
......
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