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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu May 3 15:26:20 CEST 2007


Author: seb
Date: Thu May  3 15:26:19 2007
New Revision: 14330

URL: http://svn.erp5.org?rev=14330&view=rev
Log:
make sure to check counter date with other dates

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=14330&r1=14329&r2=14330&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/testERP5BankingAvailableInventory.py (original)
+++ erp5/trunk/products/ERP5Banking/tests/testERP5BankingAvailableInventory.py Thu May  3 15:26:19 2007
@@ -67,6 +67,8 @@
 
   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
+  - it must not be possible to open two counter dates by the same time
+    even if there is different dates
   - 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
@@ -124,7 +126,24 @@
     workflow_history = self.workflow_tool.getInfoFor(
            ob=self.counter_date_2, name='history', wf_id='counter_date_workflow')
     # check its len is 2
-    # check we get an "Insufficient balance" message in the workflow history because of the invalid line
+    msg = workflow_history[-1]['error_message']
+    self.assertTrue('there is already a counter date opened' in "%s" %(msg,))
+
+  def stepCheckOpenCounterDateTwiceWithOtherDateFail(self, sequence=None, sequence_list=None, **kwd):
+    """
+    Make sure we can not open the counter date twice
+    """
+    self.openCounterDate(site=self.paris,id='counter_date_7',open=0)
+    self.counter_date_7.setStartDate(DateTime()-1)
+    # open counter date and counter
+    self.assertRaises(ValidationFailed,
+                     self.workflow_tool.doActionFor,
+                     self.counter_date_7,'open_action',
+                     wf_id='counter_date_workflow')
+    # get workflow history
+    workflow_history = self.workflow_tool.getInfoFor(
+           ob=self.counter_date_7, name='history', wf_id='counter_date_workflow')
+    # check its len is 2
     msg = workflow_history[-1]['error_message']
     self.assertTrue('there is already a counter date opened' in "%s" %(msg,))
 
@@ -293,7 +312,8 @@
                       'CheckBadStockBeforeClosingDate ' \
                       'ResetInventoryInSortVault Tic ' \
                       'CheckRightStockBeforeClosingDate ' \
-                      'CheckReferenceIsIncreasedEveryDay '
+                      'CheckReferenceIsIncreasedEveryDay ' \
+                      'CheckOpenCounterDateTwiceWithOtherDateFail Tic ' 
     sequence_list.addSequenceString(sequence_string)
     # play the sequence
     sequence_list.play(self)




More information about the Erp5-report mailing list