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

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jul 23 12:03:49 CEST 2007


Author: jerome
Date: Mon Jul 23 12:03:48 2007
New Revision: 15275

URL: http://svn.erp5.org?rev=15275&view=rev
Log:
tests automatic attribution of source and destination reference on accounting
transactions.


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=15275&r1=15274&r2=15275&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Mon Jul 23 12:03:48 2007
@@ -1679,7 +1679,27 @@
                                   payment_mode='check',
                                   batch_mode=1)
     self._checkRelatedSalePayment(invoice, payment, payment_node, 100)
-    
+
+  def test_SourceDestinationReference(self):
+    """Check that source reference and destination reference are filled
+    automatically.
+    """
+    # clear all existing ids in portal ids
+    if hasattr(self.portal.portal_ids, 'dict_ids'):
+      self.portal.portal_ids.clear()
+    accounting_transaction = self.createAccountingTransaction()
+    self.portal.portal_workflow.doActionFor(
+          accounting_transaction, 'stop_action')
+    self.assertEquals('1', accounting_transaction.getSourceReference())
+    self.assertEquals('1', accounting_transaction.getDestinationReference())
+
+    other_transaction = self.createAccountingTransaction()
+    other_transaction.setDestinationSectionValue(self.other_vendor)
+    self.portal.portal_workflow.doActionFor(other_transaction, 'stop_action')
+    self.assertEquals('2', other_transaction.getSourceReference())
+    self.assertEquals('1', other_transaction.getDestinationReference())
+
+
 def test_suite():
   suite = unittest.TestSuite()
   suite.addTest(unittest.makeSuite(TestAccounting))




More information about the Erp5-report mailing list