Commit 62ec9a3e authored by Jérome Perrin's avatar Jérome Perrin

Update, because we now validate accounting period as activity.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5505 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b353eaff
...@@ -39,12 +39,14 @@ os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log') ...@@ -39,12 +39,14 @@ os.environ['EVENT_LOG_FILE'] = os.path.join(os.getcwd(), 'zLOG.log')
os.environ['EVENT_LOG_SEVERITY'] = '-300' os.environ['EVENT_LOG_SEVERITY'] = '-300'
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.DCWorkflow.DCWorkflow import ValidationFailed
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG from zLOG import LOG
from testPackingList import TestPackingListMixin from testPackingList import TestPackingListMixin
from Products.ERP5Type.tests.Sequence import Sequence, SequenceList from Products.ERP5Type.tests.Sequence import Sequence, SequenceList
from DateTime import DateTime from DateTime import DateTime
class TestAccounting(ERP5TypeTestCase): class TestAccounting(ERP5TypeTestCase):
"""Test Accounting. """ """Test Accounting. """
...@@ -179,9 +181,16 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -179,9 +181,16 @@ class TestAccounting(ERP5TypeTestCase):
accounting_period = sequence.get('accounting_period') accounting_period = sequence.get('accounting_period')
self.getPortal().portal_workflow.doActionFor( self.getPortal().portal_workflow.doActionFor(
accounting_period, accounting_period,
'deliver_action' ) 'close_action' )
self.assertEquals(accounting_period.getSimulationState(),
'closing')
def stepCheckAccountingPeriodDelivered(self, sequence, **kw):
"""Check the Accounting Period is delivered."""
accounting_period = sequence.get('accounting_period')
self.assertEquals(accounting_period.getSimulationState(), self.assertEquals(accounting_period.getSimulationState(),
'delivered') 'delivered')
def stepCreateCurrencies(self, sequence, **kw) : def stepCreateCurrencies(self, sequence, **kw) :
"""Create a some currencies. """ """Create a some currencies. """
...@@ -387,6 +396,14 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -387,6 +396,14 @@ class TestAccounting(ERP5TypeTestCase):
for invoice in invoice_list: for invoice in invoice_list:
self.getPortal().portal_workflow.doActionFor( self.getPortal().portal_workflow.doActionFor(
invoice, 'stop_action') invoice, 'stop_action')
def stepCheckStopInvoicesRefused(self, sequence, **kw) :
"""Checks that invoices cannot be validated."""
invoice_list = sequence.get('invoice_list')
for invoice in invoice_list:
self.assertRaises(ValidationFailed,
self.getPortal().portal_workflow.doActionFor,
invoice, 'stop_action')
def stepCheckInvoicesAreDraft(self, sequence, **kw) : def stepCheckInvoicesAreDraft(self, sequence, **kw) :
"""Checks invoices are in draft state.""" """Checks invoices are in draft state."""
...@@ -526,6 +543,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -526,6 +543,7 @@ class TestAccounting(ERP5TypeTestCase):
stepTic stepTic
stepDeliverAccountingPeriod stepDeliverAccountingPeriod
stepTic stepTic
stepCheckAccountingPeriodDelivered
stepCheckInvoicesAreDelivered stepCheckInvoicesAreDelivered
stepTic stepTic
stepCheckAccountingTransactionDelivered stepCheckAccountingTransactionDelivered
...@@ -544,7 +562,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -544,7 +562,7 @@ class TestAccounting(ERP5TypeTestCase):
stepTic stepTic
stepUseInvalidDates stepUseInvalidDates
stepCreateInvoices stepCreateInvoices
stepStopInvoices stepCheckStopInvoicesRefused
stepTic stepTic
stepCheckInvoicesAreDraft stepCheckInvoicesAreDraft
""") """)
...@@ -583,6 +601,7 @@ class TestAccounting(ERP5TypeTestCase): ...@@ -583,6 +601,7 @@ class TestAccounting(ERP5TypeTestCase):
stepTic stepTic
stepDeliverAccountingPeriod stepDeliverAccountingPeriod
stepTic stepTic
stepCheckAccountingPeriodDelivered
stepCheckInvoicesAreDraft stepCheckInvoicesAreDraft
""") """)
......
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