Index: testCMFActivity.py =================================================================== --- testCMFActivity.py (révision 19679) +++ testCMFActivity.py (copie de travail) @@ -1705,7 +1705,34 @@ for m in messages_for_o1: self.assertEquals(m.activity_kw.get('tag'), 'The Tag') + def test_76_ActivateKwForEdit(self, quiet=0, run=run_all_test): + if not run: return + if not quiet: + message = '\nCheck reindex message uses activate_kw passed to edit' + ZopeTestCase._print(message) + LOG('Testing... ',0,message) + o1 = self.getOrganisationModule().newContent() + # flush indexing message created by newContent. In real application, we + # would pass the tag in activate_kw for newContent as well. + get_transaction().commit(); self.tic() + + o1._edit(title="foo", activate_kw=dict(tag='The Tag')) + # first make sure edit works as expected (activate_kw should not be set as + # a property). + self.assertEquals("foo", o1.getTitle()) + self.failIf(o1.getProperty("activate_kw")) + self.failIf("activate_kw" in o1.propertyMap()) + + # then check the tag is passed + get_transaction().commit() + messages_for_o1 = [m for m in self.getActivityTool().getMessageList() + if m.object_path == o1.getPhysicalPath()] + self.assertNotEquals(0, len(messages_for_o1)) + for m in messages_for_o1: + self.assertEquals(m.activity_kw.get('tag'), 'The Tag') + + def test_77_FlushAfterMultipleActivate(self, quiet=0, run=run_all_test): if not run: return if not quiet: