[Erp5-report] r29419 - /erp5/trunk/products/ERP5Banking/tests/testERP5BankingCounterDate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Oct 6 11:18:44 CEST 2009


Author: vincent
Date: Tue Oct  6 11:18:43 2009
New Revision: 29419

URL: http://svn.erp5.org?rev=29419&view=rev
Log:
Add a variant of test checking that it is impossible to open 2 counter date on the same site, this time without executing activities.

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

Modified: erp5/trunk/products/ERP5Banking/tests/testERP5BankingCounterDate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Banking/tests/testERP5BankingCounterDate.py?rev=29419&r1=29418&r2=29419&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Banking/tests/testERP5BankingCounterDate.py [utf8] (original)
+++ erp5/trunk/products/ERP5Banking/tests/testERP5BankingCounterDate.py [utf8] Tue Oct  6 11:18:43 2009
@@ -211,6 +211,26 @@
     openAndTest(self.paris, DateTime('2008/12/31'), '5')
     openAndTest(self.paris, DateTime('2009/01/01'), '1')
 
+  def test_04_CheckOpenCounterDateTwiceWithoutActivitiesFail(self, quiet=QUIET,
+    run=RUN_ALL_TEST):
+    """
+      Test that opening a counter date when there is a counter date opened
+      fails, even when activites are not executed.
+    """
+    if not run: return
+    if not quiet:
+      message = 'Check open CounterDate twice without activities fails'
+      ZopeTestCase._print('\n%s ' % message)
+      LOG('Testing... ',0,message)
+    self.openCounterDate(site=self.paris, id='counter_date_1')
+    get_transaction().commit()
+    self.openCounterDate(site=self.paris, id='counter_date_2', open=0)
+    # open counter date and counter
+    self.assertRaises(ValidationFailed,
+                     self.workflow_tool.doActionFor,
+                     self.counter_date_2, 'open_action',
+                     wf_id='counter_date_workflow')
+
 # define how we launch the unit test
 if __name__ == '__main__':
   framework()




More information about the Erp5-report mailing list