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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 19 12:05:15 CET 2010


Author: jerome
Date: Tue Jan 19 12:05:14 2010
New Revision: 31817

URL: http://svn.erp5.org?rev=31817&view=rev
Log:
tests the case of an invoice that will have lines grouped together

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=31817&r1=31816&r2=31817&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py [utf8] (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py [utf8] Tue Jan 19 12:05:14 2010
@@ -2716,6 +2716,34 @@
     self.failIf(invoice_line.getGroupingReference())
     self.failIf(payment_line.getGroupingReference())
 
+  def test_automatically_setting_grouping_reference_in_one_invoice(self):
+    # this invoice will group it itself
+    invoice = self._makeOne(
+               title='One Invoice',
+               simulation_state='stopped',
+               destination_section_value=self.organisation_module.client_1,
+               lines=(dict(source_value=self.account_module.receivable,
+                           source_debit=100),
+                      dict(source_value=self.account_module.receivable,
+                           source_credit=100, )))
+    transaction.commit()
+    self.tic()
+    for line in invoice.contentValues():
+      self.assertTrue(line.getGroupingReference())
+
+    invoice.restart()
+    transaction.commit()
+    self.tic()
+    for line in invoice.contentValues():
+      self.assertFalse(line.getGroupingReference())
+
+    invoice.stop()
+    transaction.commit()
+    self.tic()
+    for line in invoice.contentValues():
+      self.assertTrue(line.getGroupingReference())
+
+ 
   def test_AccountingTransaction_getTotalDebitCredit(self):
     # source view
     accounting_transaction = self._makeOne(




More information about the Erp5-report mailing list