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

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 29 15:07:50 CET 2008


Author: jerome
Date: Tue Jan 29 15:07:49 2008
New Revision: 18902

URL: http://svn.erp5.org?rev=18902&view=rev
Log:
generate differents transaction references based on the year.


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=18902&r1=18901&r2=18902&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/tests/testAccounting.py (original)
+++ erp5/trunk/products/ERP5/tests/testAccounting.py Tue Jan 29 15:07:49 2008
@@ -2962,17 +2962,28 @@
     # clear all existing ids in portal ids
     if hasattr(self.portal.portal_ids, 'dict_ids'):
       self.portal.portal_ids.dict_ids.clear()
-    accounting_transaction = self.createAccountingTransaction()
+    accounting_transaction = self.createAccountingTransaction(
+                                  start_date=DateTime(2001, 01, 01),
+                                  stop_date=DateTime(2001, 01, 01))
     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()
+    self.assertEquals('2001-1', accounting_transaction.getSourceReference())
+    self.assertEquals('2001-1', accounting_transaction.getDestinationReference())
+
+    other_transaction = self.createAccountingTransaction(
+                                  start_date=DateTime(2001, 01, 01),
+                                  stop_date=DateTime(2001, 01, 01))
     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())
+    self.assertEquals('2001-2', other_transaction.getSourceReference())
+    self.assertEquals('2001-1', other_transaction.getDestinationReference())
+
+    next_year_transaction = self.createAccountingTransaction(
+                                  start_date=DateTime(2002, 01, 01),
+                                  stop_date=DateTime(2002, 01, 01))
+    self.portal.portal_workflow.doActionFor(next_year_transaction, 'stop_action')
+    self.assertEquals('2002-1', next_year_transaction.getSourceReference())
+    self.assertEquals('2002-1', next_year_transaction.getDestinationReference())
 
 
 def test_suite():




More information about the Erp5-report mailing list