[Erp5-report] r14073 - /erp5/trunk/products/ERP5Banking/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 13 16:18:56 CEST 2007


Author: seb
Date: Fri Apr 13 16:18:54 2007
New Revision: 14073

URL: http://svn.erp5.org?rev=14073&view=rev
Log:
add a test for the unique reference of each counter date

Modified:
    erp5/trunk/products/ERP5Banking/tests/testERP5BankingAvailableInventory.py

Modified: erp5/trunk/products/ERP5Banking/tests/testERP5BankingAvailableInventory.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/tests/testERP5BankingAvailableInventory.py?rev=14073&r1=14072&r2=14073&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/testERP5BankingAvailableInventory.py (original)
+++ erp5/trunk/products/ERP5Banking/tests/testERP5BankingAvailableInventory.py Fri Apr 13 16:18:54 2007
@@ -65,7 +65,9 @@
   We must make sure that future incoming movements will not be
   taken into account
 
-  We will by the way check the way counter dates are working.
+  We will by the way check the way counter dates are working :
+  - it must not be possible to open two counter dates by the same time
+  - make sure the reference defined on counter dates is increased every day
 
   Also, we must make sure it is not possible to deliver two check
   payments by the same time (due to tag on counter)
@@ -210,6 +212,33 @@
     self.assertEqual(self.currency_1.getCurrentInventory(payment=self.bank_account_1.getRelativeUrl()), 30000)
     self.assertEqual(self.currency_1.getAvailableInventory(payment=self.bank_account_1.getRelativeUrl()), 30000)
     self.assertEqual(self.currency_1.getFutureInventory(payment=self.bank_account_1.getRelativeUrl()), 30000)
+
+  def stepCheckReferenceIsIncreasedEveryDay(self, sequence=None, sequence_list=None, **kwd):
+    """
+    make sure the reference is increasing
+    """
+    counter_date = self.counter_date_1
+    counter_date.setStartDate(self.date-10)
+    self.assertEquals(counter_date.getReference(),'1')
+    get_transaction().commit()
+    self.tic()
+    self.openCounterDate(site=self.paris, id='counter_date_3')
+    counter_date = self.counter_date_3
+    self.assertEquals(counter_date.getReference(),'2')
+    counter_date.close()
+    counter_date.setStartDate(self.date-9)
+    get_transaction().commit()
+    self.tic()
+    self.openCounterDate(site=self.paris, id='counter_date_4')
+    counter_date = self.counter_date_4
+    self.assertEquals(counter_date.getReference(),'3')
+    counter_date.close()
+    counter_date.setStartDate(self.date-8)
+    get_transaction().commit()
+    self.tic()
+    self.openCounterDate(site=self.paris, id='counter_date_5')
+    counter_date = self.counter_date_5
+    self.assertEquals(counter_date.getReference(),'4')
 
 
   def test_01_ERP5BankingAvailabeInventory(self, quiet=QUIET, run=RUN_ALL_TEST):
@@ -241,7 +270,8 @@
                       'CheckAccountFinalInventory ' \
                       'CheckBadStockBeforeClosingDate ' \
                       'ResetInventory Tic ' \
-                      'CheckRightStockBeforeClosingDate '
+                      'CheckRightStockBeforeClosingDate ' \
+                      'CheckReferenceIsIncreasedEveryDay '
     sequence_list.addSequenceString(sequence_string)
     # play the sequence
     sequence_list.play(self)




More information about the Erp5-report mailing list