[Erp5-report] r26842 - /erp5/trunk/products/ERP5/tests/testAccounting.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed May 6 15:23:40 CEST 2009
Author: jerome
Date: Wed May 6 15:23:38 2009
New Revision: 26842
URL: http://svn.erp5.org?rev=26842&view=rev
Log:
add tests for transaction validate before any accounting period, and after all
accounting periods
Modified:
erp5/trunk/products/ERP5/tests/testAccounting.py
Modified: erp5/trunk/products/ERP5/tests/testAccounting.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccounting.py?rev=26842&r1=26841&r2=26842&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py [utf8] Wed May 6 15:23:38 2009
@@ -421,6 +421,39 @@
transaction.setStartDate(DateTime("2007/01/01"))
self.portal.portal_workflow.doActionFor(transaction, 'stop_action')
+ def test_AccountingTransactionValidationBeforePeriod(self):
+ # Check we cannot validate before the period
+ transaction = self._makeOne(
+ portal_type='Accounting Transaction',
+ start_date=DateTime('2003/12/31'),
+ destination_section_value=self.organisation_module.supplier,
+ payment_mode='default',
+ lines=(dict(source_value=self.account_module.goods_purchase,
+ source_debit=500),
+ dict(source_value=self.account_module.receivable,
+ source_credit=500)))
+ # validation is refused, because there are no open period for 2008
+ self.assertRaises(ValidationFailed,
+ self.portal.portal_workflow.doActionFor,
+ transaction, 'stop_action')
+
+ def test_AccountingTransactionValidationAfterPeriod(self):
+ # Check we cannot validate after the period
+ transaction = self._makeOne(
+ portal_type='Accounting Transaction',
+ start_date=DateTime('2008/12/31'),
+ destination_section_value=self.organisation_module.supplier,
+ payment_mode='default',
+ lines=(dict(source_value=self.account_module.goods_purchase,
+ source_debit=500),
+ dict(source_value=self.account_module.receivable,
+ source_credit=500)))
+ # validation is refused, because there are no open period for 2008
+ self.assertRaises(ValidationFailed,
+ self.portal.portal_workflow.doActionFor,
+ transaction, 'stop_action')
+
+
def test_PaymentTransactionWithEmployee(self):
# we have to set bank account if we use an asset/cash/bank account, but not
# for our employees
More information about the Erp5-report
mailing list