From 51d6c604126da7f25c32c4092fd9c224019107fb Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 2 Oct 2010 14:50:17 +0000 Subject: [PATCH] Use the right event subscriber to make sure all comments are removed from the catalog, if their content object is deleted. svn path=/plone.app.discussion/trunk/; revision=40485 --- plone/app/discussion/subscribers.zcml | 2 +- plone/app/discussion/tests/test_catalog.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plone/app/discussion/subscribers.zcml b/plone/app/discussion/subscribers.zcml index 0323996..89918b1 100644 --- a/plone/app/discussion/subscribers.zcml +++ b/plone/app/discussion/subscribers.zcml @@ -39,7 +39,7 @@ diff --git a/plone/app/discussion/tests/test_catalog.py b/plone/app/discussion/tests/test_catalog.py index da7924f..3618f9c 100644 --- a/plone/app/discussion/tests/test_catalog.py +++ b/plone/app/discussion/tests/test_catalog.py @@ -277,10 +277,15 @@ class CommentCatalogTest(PloneTestCase): self.assertEquals(len(brains), 0) def test_remove_comments_when_content_object_is_removed(self): - # Make sure all comments are removed from the catalog, if the content - # object is removed. - pass - + """Make sure all comments are removed from the catalog, if the content + object is removed. + """ + brains = self.catalog.searchResults(portal_type = 'Discussion Item') + self.assertEquals(len(brains), 1) + self.portal.manage_delObjects(["doc1"]) + brains = self.catalog.searchResults(portal_type = 'Discussion Item') + self.assertEquals(len(brains), 0) + def test_clear_and_rebuild_catalog(self): # Clear and rebuild catalog self.catalog.clearFindAndRebuild()