[Erp5-report] r35197 seb - /erp5/trunk/products/CMFActivity/tests/testCMFActivity.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed May 12 14:01:36 CEST 2010
Author: seb
Date: Wed May 12 14:01:30 2010
New Revision: 35197
URL: http://svn.erp5.org?rev=35197&view=rev
Log:
add a test to make sure that we will not have regression
fixed by revision 35192 (wrong sql connector used by Id tool)
Modified:
erp5/trunk/products/CMFActivity/tests/testCMFActivity.py
Modified: erp5/trunk/products/CMFActivity/tests/testCMFActivity.py
URL: http://svn.erp5.org/erp5/trunk/products/CMFActivity/tests/testCMFActivity.py?rev=35197&r1=35196&r2=35197&view=diff
==============================================================================
--- erp5/trunk/products/CMFActivity/tests/testCMFActivity.py [utf8] (original)
+++ erp5/trunk/products/CMFActivity/tests/testCMFActivity.py [utf8] Wed May 12 14:01:30 2010
@@ -3757,6 +3757,39 @@
ZopeTestCase._print(message)
LOG('Testing... ',0,message)
self.TryNotificationSavedOnEventLogWhenSiteErrorLoggerRaises('SQLQueue')
+
+ def test_124_checkConflictErrorAndNoRemainingActivities(self):
+ """
+ When an activity creates several activities, make sure that all newly
+ created activities are not commited if there is ZODB Conflict error
+ """
+ from Products.CMFActivity.Activity import SQLQueue
+ old_MAX_MESSAGE_LIST_SIZE = SQLQueue.MAX_MESSAGE_LIST_SIZE
+ SQLQueue.MAX_MESSAGE_LIST_SIZE = 1
+ try:
+ activity_tool = self.getPortal().portal_activities
+ def doSomething(self):
+ self.serialize()
+ self.activate(activity='SQLQueue').getId()
+ self.activate(activity='SQLQueue').getTitle()
+ conn = self._p_jar
+ tid = self._p_serial
+ oid = self._p_oid
+ try:
+ conn.db().invalidate({oid: tid})
+ except TypeError:
+ conn.db().invalidate(tid, {oid: tid})
+
+ activity_tool.__class__.doSomething = doSomething
+ activity_tool.activate(activity='SQLQueue').doSomething()
+ get_transaction().commit()
+ activity_tool.distribute()
+ activity_tool.tic()
+ message_list = activity_tool.getMessageList()
+ self.assertEquals(['doSomething'],[x.method_id for x in message_list])
+ activity_tool.manageClearActivities(keep=0)
+ finally:
+ SQLQueue.MAX_MESSAGE_LIST_SIZE = old_MAX_MESSAGE_LIST_SIZE
def test_suite():
suite = unittest.TestSuite()
More information about the Erp5-report
mailing list