[Erp5-report] r33360 kazuhiko - /erp5/trunk/products/ERP5/tests/testAccountingRules.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 4 06:57:53 CET 2010


Author: kazuhiko
Date: Thu Mar  4 06:57:53 2010
New Revision: 33360

URL: http://svn.erp5.org?rev=33360&view=rev
Log:
* assert mirrored case for built payment transaction.
* configure payment rule for each test.

Modified:
    erp5/trunk/products/ERP5/tests/testAccountingRules.py

Modified: erp5/trunk/products/ERP5/tests/testAccountingRules.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/tests/testAccountingRules.py?rev=33360&r1=33359&r2=33360&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccountingRules.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testAccountingRules.py [utf8] Thu Mar  4 06:57:53 2010
@@ -1502,16 +1502,28 @@
     }
 
     for payment_transaction_line in payment_transaction_line_list :
-      self.assert_(
-          payment_transaction_line.getSourceId() in accounting_lines_layout.keys(),
-          'unexepected source_id %s' % payment_transaction_line.getSourceId())
-      debit, credit = accounting_lines_layout[
-                            payment_transaction_line.getSourceId()]
-      self.assertEquals(debit, payment_transaction_line.getSourceDebit())
-      self.assertEquals(credit, payment_transaction_line.getSourceCredit())
-      self.assertNotEquals(
-              len(payment_transaction_line.getDeliveryRelatedValueList(
-                              portal_type='Simulation Movement')), 0)
+      if _isMirrored(payment_transaction_line):
+        self.assert_(
+            payment_transaction_line.getDestinationId() in accounting_lines_layout.keys(),
+            'unexepected source_id %s' % payment_transaction_line.getDestinationId())
+        debit, credit = accounting_lines_layout[
+                              payment_transaction_line.getDestinationId()]
+        self.assertEquals(debit, payment_transaction_line.getDestinationDebit())
+        self.assertEquals(credit, payment_transaction_line.getDestinationCredit())
+        self.assertNotEquals(
+                len(payment_transaction_line.getDeliveryRelatedValueList(
+                                portal_type='Simulation Movement')), 0)
+      else:
+        self.assert_(
+            payment_transaction_line.getSourceId() in accounting_lines_layout.keys(),
+            'unexepected source_id %s' % payment_transaction_line.getSourceId())
+        debit, credit = accounting_lines_layout[
+                              payment_transaction_line.getSourceId()]
+        self.assertEquals(debit, payment_transaction_line.getSourceDebit())
+        self.assertEquals(credit, payment_transaction_line.getSourceCredit())
+        self.assertNotEquals(
+                len(payment_transaction_line.getDeliveryRelatedValueList(
+                                portal_type='Simulation Movement')), 0)
 
   def stepRebuildAndCheckNothingIsCreated(self, sequence, **kw) :
     """ Calls the DeliveryBuilder again and checks that the accounting module
@@ -2076,8 +2088,9 @@
       stepCreateCurrencies
       stepCreateProducts
       stepCreateInvoiceTransactionRule
-      stepTic
       stepUpdateInvoiceTransactionRuleMatrix
+      stepCreatePaymentRule
+      stepUpdatePaymentRuleMatrix
       stepValidateInvoiceTransaction
       stepTic
       stepCreateNotebookFranceCell
@@ -2114,8 +2127,9 @@
       stepCreateCurrencies
       stepCreateProducts
       stepCreateInvoiceTransactionRule
-      stepTic
       stepUpdateInvoiceTransactionRuleMatrix
+      stepCreatePaymentRule
+      stepUpdatePaymentRuleMatrix
       stepValidateInvoiceTransaction
       stepTic
       stepCreateNotebookFranceCell




More information about the Erp5-report mailing list