From 768b2095de8f5a479003d809a048f25365e04545 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 24 Jun 2009 20:11:27 +0000 Subject: [PATCH] fix tests for bugfix 834504 ("Replies have a wrong path index.") svn path=/plone.app.discussion/trunk/; revision=27661 --- plone/app/discussion/tests/test_comment.py | 4 ++-- plone/app/discussion/tests/test_conversation.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/tests/test_comment.py b/plone/app/discussion/tests/test_comment.py index e3b00ef..5177fd8 100644 --- a/plone/app/discussion/tests/test_comment.py +++ b/plone/app/discussion/tests/test_comment.py @@ -183,8 +183,8 @@ class RepliesTest(PloneTestCase): comment = createObject('plone.Comment') comment.title = 'Comment 1' comment.text = 'Comment text' - new_id = replies.addComment(comment) + comment = self.portal.doc1.restrictedTraverse('++conversation++default/%s' % new_id) # Add a reply to the CommentReplies adapter of the first comment re_comment = createObject('plone.Comment') @@ -220,8 +220,8 @@ class RepliesTest(PloneTestCase): comment = createObject('plone.Comment') comment.title = 'Comment 1' comment.text = 'Comment text' - new_id = replies.addComment(comment) + comment = self.portal.doc1.restrictedTraverse('++conversation++default/%s' % new_id) # Add a reply to the CommentReplies adapter of the first comment re_comment = createObject('plone.Comment') diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index b8c1a3e..c8347d0 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -747,11 +747,14 @@ class RepliesTest(PloneTestCase): # Create the nested comment structure new_id_1 = replies.addComment(comment1) + comment1 = self.portal.doc1.restrictedTraverse('++conversation++default/%s' % new_id_1) replies_to_comment1 = IReplies(comment1) new_id_2 = replies.addComment(comment2) + comment2 = self.portal.doc1.restrictedTraverse('++conversation++default/%s' % new_id_2) replies_to_comment2 = IReplies(comment2) new_id_1_1 = replies_to_comment1.addComment(comment1_1) + comment1_1 = self.portal.doc1.restrictedTraverse('++conversation++default/%s' % new_id_1_1) replies_to_comment1_1 = IReplies(comment1_1) new_id_1_1_1 = replies_to_comment1_1.addComment(comment1_1_1)