Commit 83a2f63c authored by Romain Courteaud's avatar Romain Courteaud

slapos_accounting: test: drop outdated tests

parent d91eb97f
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
import transaction import transaction
import time
from functools import wraps from functools import wraps
from Products.ERP5Type.tests.utils import createZODBPythonScript from Products.ERP5Type.tests.utils import createZODBPythonScript
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin, withAbort from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin, withAbort
...@@ -35,7 +34,6 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin, withAbo ...@@ -35,7 +34,6 @@ from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin, withAbo
import os import os
import tempfile import tempfile
from DateTime import DateTime from DateTime import DateTime
from zExceptions import Unauthorized
AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL = 'sale_trade_condition_module/slapos_aggregated_trade_condition_v3' AGGREGATE_SALE_TRADE_CONDITION_RELATIVE_URL = 'sale_trade_condition_module/slapos_aggregated_trade_condition_v3'
...@@ -496,116 +494,6 @@ class TestSlapOSStopConfirmedAggregatedSaleInvoiceTransactionAlarm( ...@@ -496,116 +494,6 @@ class TestSlapOSStopConfirmedAggregatedSaleInvoiceTransactionAlarm(
portal_type = 'Sale Invoice Transaction' portal_type = 'Sale Invoice Transaction'
alarm = 'slapos_stop_confirmed_aggregated_sale_invoice_transaction' alarm = 'slapos_stop_confirmed_aggregated_sale_invoice_transaction'
class TestSlapOSUpdateOpenSaleOrderPeriod(SlapOSTestCaseMixin):
def createOpenOrder(self):
open_order = self.portal.open_sale_order_module.newContent(
portal_type="Open Sale Order",
ledger='automated',
title=self.generateNewSoftwareTitle(),
reference="TESTHS-%s" % self.generateNewId(),
)
open_order.order()
open_order.validate()
return open_order
def test_updatePeriod_REQUEST_disallowed(self):
self.assertRaises(
Unauthorized,
self.portal.OpenSaleOrder_updatePeriod,
REQUEST={})
def test_updatePeriod_no_person(self):
open_order = self.createOpenOrder()
open_order.OpenSaleOrder_updatePeriod()
def test_updatePeriod_validated(self):
open_order = self.createOpenOrder()
person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1)
open_order.edit(
destination_decision_value=person,
)
open_order.newContent(
portal_type="Open Sale Order Line"
)
self.assertRaises(AssertionError, open_order.OpenSaleOrder_updatePeriod)
def test_updatePeriod_invalidated(self):
open_order = self.createOpenOrder()
person = self.portal.person_module.template_member\
.Base_createCloneDocument(batch_mode=1)
open_order.edit(
destination_decision_value=person,
)
open_order.invalidate()
open_order.newContent(
portal_type="Open Sale Order Line"
)
open_order.OpenSaleOrder_updatePeriod()
def test_alarm(self):
open_order = self.createOpenOrder()
open_order.newContent(portal_type="Open Sale Order Line")
self.tic()
script_name = "OpenSaleOrder_updatePeriod"
alarm = self.portal.portal_alarms.slapos_update_open_sale_order_period
self._test_alarm(
alarm, open_order, script_name)
def test_alarm_invalidated(self):
open_order = self.createOpenOrder()
open_order.newContent(portal_type="Open Sale Order Line")
open_order.invalidate()
self.tic()
script_name = "OpenSaleOrder_updatePeriod"
alarm = self.portal.portal_alarms.slapos_update_open_sale_order_period
self._test_alarm_not_visited(
alarm, open_order, script_name)
def test_alarm_no_line(self):
open_order = self.createOpenOrder()
self.tic()
script_name = "OpenSaleOrder_updatePeriod"
alarm = self.portal.portal_alarms.slapos_update_open_sale_order_period
self._test_alarm_not_visited(
alarm, open_order, script_name)
class TestSlapOSReindexOpenSaleOrder(SlapOSTestCaseMixin):
def createOpenOrder(self):
return self.portal.open_sale_order_module.newContent(
portal_type="Open Sale Order",
ledger='automated',
title=self.generateNewSoftwareTitle(),
reference="TESTHS-%s" % self.generateNewId(),
)
def test_alarm(self):
open_order = self.createOpenOrder()
self.tic()
# Jut wait a bit so the line has a different timestamp > 1 sec.
time.sleep(1)
open_order.newContent(portal_type="Open Sale Order Line")
self.tic()
script_name = "OpenSaleOrder_reindexIfIndexedBeforeLine"
alarm = self.portal.portal_alarms.slapos_reindex_open_sale_order
self._test_alarm(
alarm, open_order, script_name)
def test_alarm_no_line(self):
open_order = self.createOpenOrder()
self.tic()
script_name = "OpenSaleOrder_reindexIfIndexedBeforeLine"
alarm = self.portal.portal_alarms.slapos_reindex_open_sale_order
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