[Erp5-report] r16560 - /erp5/trunk/products/ERP5/tests/testAccounting.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sun Sep 23 19:08:00 CEST 2007


Author: jerome
Date: Sun Sep 23 19:07:59 2007
New Revision: 16560

URL: http://svn.erp5.org?rev=16560&view=rev
Log:
always pass profit_and_loss_account= parameter to
AccountingPeriod_createBalanceTransaction , it is now required.

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=16560&r1=16559&r2=16560&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Sun Sep 23 19:07:59 2007
@@ -250,7 +250,8 @@
                dict(source_value=self.account_module.goods_purchase,
                     source_credit=100)))
 
-    period.AccountingPeriod_createBalanceTransaction()
+    period.AccountingPeriod_createBalanceTransaction(
+                               profit_and_loss_account=None)
     accounting_transaction_list = self.accounting_module.contentValues()
     self.assertEquals(3, len(accounting_transaction_list))
     balance_transaction_list = self.accounting_module.contentValues(
@@ -338,7 +339,8 @@
                dict(source_value=self.account_module.receivable,
                     source_credit=200)))
 
-    period.AccountingPeriod_createBalanceTransaction()
+    period.AccountingPeriod_createBalanceTransaction(
+                             profit_and_loss_account=None)
     accounting_transaction_list = self.accounting_module.contentValues()
     self.assertEquals(3, len(accounting_transaction_list))
     balance_transaction_list = self.accounting_module.contentValues(
@@ -445,7 +447,8 @@
                dict(destination_value=self.account_module.goods_purchase,
                     destination_credit=200)))
 
-    period.AccountingPeriod_createBalanceTransaction()
+    period.AccountingPeriod_createBalanceTransaction(
+                             profit_and_loss_account=None)
     accounting_transaction_list = self.accounting_module.contentValues()
     self.assertEquals(3, len(accounting_transaction_list))
     balance_transaction_list = self.accounting_module.contentValues(
@@ -566,7 +569,8 @@
                     source_asset_credit=2.2,
                     source_credit=200)))
 
-    period.AccountingPeriod_createBalanceTransaction()
+    period.AccountingPeriod_createBalanceTransaction(
+                              profit_and_loss_account=None)
     accounting_transaction_list = self.accounting_module.contentValues()
     self.assertEquals(3, len(accounting_transaction_list))
     balance_transaction_list = self.accounting_module.contentValues(
@@ -1329,9 +1333,11 @@
   def stepDeliverAccountingPeriod(self, sequence, **kw):
     """Deliver the Accounting Period."""
     accounting_period = sequence.get('accounting_period')
+    # take any account for profit and loss account, here we don't care
+    profit_and_loss_account = self.portal.account_module.contentValues()[0]
     self.getPortal().portal_workflow.doActionFor(
-                        accounting_period,
-                        'deliver_action' )
+           accounting_period, 'deliver_action',
+           profit_and_loss_account=profit_and_loss_account.getRelativeUrl())
     self.assertEquals(accounting_period.getSimulationState(),
                       'delivered')
     
@@ -2223,8 +2229,8 @@
 
   def test_AccountingPeriodRefusesWrongDateTransactionValidation(
         self, quiet=QUIET, run=RUN_ALL_TESTS):
-    """Accounting Periods prevents transactions to be validated
-        when there is no oppened accounting period"""
+    """Accounting Periods prevents transactions from being validated when there
+    is no oppened accounting period"""
     if not run : return
     self.playSequence("""
       stepCreateCurrencies




More information about the Erp5-report mailing list