[Erp5-report] r24222 - /erp5/trunk/products/ERP5/tests/testAccounting.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Oct 17 11:25:10 CEST 2008
Author: jerome
Date: Fri Oct 17 11:25:09 2008
New Revision: 24222
URL: http://svn.erp5.org?rev=24222&view=rev
Log:
reindex the created balance transaction in test_createBalanceOnMirrorSection
for this we need a valid p&l account
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=24222&r1=24221&r2=24222&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Fri Oct 17 11:25:09 2008
@@ -831,6 +831,9 @@
period = self.section.newContent(portal_type='Accounting Period')
period.setStartDate(DateTime(2006, 1, 1))
period.setStopDate(DateTime(2006, 12, 31))
+ pl = self.portal.account_module.newContent(
+ portal_type='Account',
+ account_type='equity')
transaction1 = self._makeOne(
start_date=DateTime(2006, 1, 1),
@@ -853,7 +856,7 @@
source_credit=200)))
period.AccountingPeriod_createBalanceTransaction(
- profit_and_loss_account=None)
+ profit_and_loss_account=pl.getRelativeUrl())
accounting_transaction_list = self.accounting_module.contentValues()
self.assertEquals(3, len(accounting_transaction_list))
balance_transaction_list = self.accounting_module.contentValues(
@@ -907,19 +910,20 @@
self.assertEquals(200., client2_movement.getDestinationCredit())
pl_movement_list = [m for m in movement_list
- if m.getDestination() is None]
+ if m.getDestinationValue() == pl]
self.assertEquals(1, len(pl_movement_list))
pl_movement = pl_movement_list[0]
self.assertEquals([], pl_movement.getValueList('resource'))
self.assertEquals(None, pl_movement.getSource())
- self.assertEquals(None,
+ self.assertEquals(pl,
pl_movement.getDestinationValue())
self.assertEquals(None,
pl_movement.getSourceSection())
self.assertEquals(None, pl_movement.getDestinationTotalAssetPrice())
self.assertEquals(None, pl_movement.getSourceTotalAssetPrice())
self.assertEquals(300., pl_movement.getDestinationDebit())
-
+ get_transaction().commit()
+ self.tic()
def test_createBalanceOnPayment(self):
organisation_module = self.organisation_module
More information about the Erp5-report
mailing list