From 6e226be248adb6ae079166170d475d725a1680e6 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Tue, 16 Mar 2010 11:09:40 +0000 Subject: [PATCH] failing test for Pivotal Tracker issue #2494228 added (comment out test for now). svn path=/plone.app.discussion/trunk/; revision=34915 --- .../app/discussion/tests/test_conversation.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index 1347f49..823ef39 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -143,6 +143,24 @@ class ConversationTest(PloneTestCase): {'comment': comment2_1, 'depth': 1, 'id': new_id_2_1}, ], list(conversation.getThreads())) + def test_delete_comment_when_content_object_is_deleted(self): + # Make sure all comments of a content object are deleted when the object + # itself is deleted. + conversation = IConversation(self.portal.doc1) + comment = createObject('plone.Comment') + comment.title = 'Comment 1' + comment.text = 'Comment text' + new_id = conversation.addComment(comment) + + # Delete the content object + self.portal.manage_delObjects(['doc1']) + + # Make sure the comment has been deleted as well + # XXX: Failing! Pivotal Tracker issue #2494228. + #self.assertEquals(len(list(conversation.getComments())), 0) + #self.assertEquals(sum(1 for w in conversation.getThreads()), 0) + #self.assertEquals(conversation.total_comments, 0) + def test_allow_discussion(self): # This is not a real test! It's only there to understand the # allow discussion attribute. Maybe we should remove this at