From 0cf95cb5f0ad36ae1d202cae0d9e8da9bf5005f1 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 27 Nov 2007 09:24:56 +0000
Subject: [PATCH] make sure when there is some Conflict Errors that we do we do
 not delete the message without executing it.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17809 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFActivity/tests/testCMFActivity.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/product/CMFActivity/tests/testCMFActivity.py b/product/CMFActivity/tests/testCMFActivity.py
index a148cdf68a..6fd8df5ca3 100644
--- a/product/CMFActivity/tests/testCMFActivity.py
+++ b/product/CMFActivity/tests/testCMFActivity.py
@@ -681,8 +681,12 @@ class TestCMFActivity(ERP5TypeTestCase):
       if self.__class__.current_num_conflict_errors < limit:
         self.__class__.current_num_conflict_errors += 1
         raise ConflictError
+      else:
+        foobar = getattr(self, 'foobar', 0)
+        setattr(self, 'foobar', foobar + 1)
     Organisation.induceConflictErrors = induceConflictErrors
 
+    setattr(o, 'foobar', 0)
     # Test some range of conflict error occurences.
     for i in xrange(10):
       Organisation.current_num_conflict_errors = 0
@@ -690,6 +694,7 @@ class TestCMFActivity(ERP5TypeTestCase):
       get_transaction().commit()
       self.flushAllActivities(silent = 1, loop_size = i + 10)
       self.assertEquals(len(activity_tool.getMessageList()), 0)
+    self.assertEqual(getattr(o, 'foobar', 0), 10)
 
   def TryConflictErrorsWhileValidating(self, activity):
     """Try to execute active objects which may throw conflict errors
-- 
2.30.9