From ebc4c408e3401966e6235b5402feadbe300fda2d Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Tue, 16 Mar 2010 10:52:25 +0000 Subject: [PATCH] fix tests for conversation.getThreads generator. svn path=/plone.app.discussion/trunk/; revision=34911 --- plone/app/discussion/tests/test_conversation.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index 4f6ada0..1347f49 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -47,8 +47,7 @@ class ConversationTest(PloneTestCase): self.assertEquals(aq_base(conversation[new_id].__parent__), aq_base(conversation)) self.assertEquals(new_id, comment.comment_id) self.assertEquals(len(list(conversation.getComments())), 1) - # XXX: not yet implemented - # self.assertEquals(len(conversation.getThreads()), 1) + self.assertEquals(sum(1 for w in conversation.getThreads()), 1) self.assertEquals(conversation.total_comments, 1) self.assert_(conversation.last_comment_date - datetime.now() < timedelta(seconds=1)) @@ -68,8 +67,7 @@ class ConversationTest(PloneTestCase): # make sure the comment has been added self.assertEquals(len(list(conversation.getComments())), 1) - # XXX: not yet implemented - # self.assertEquals(len(conversation.getThreads()), 1) + self.assertEquals(sum(1 for w in conversation.getThreads()), 1) self.assertEquals(conversation.total_comments, 1) # delete the comment we just created @@ -77,9 +75,7 @@ class ConversationTest(PloneTestCase): # make sure there is no comment left in the conversation self.assertEquals(len(list(conversation.getComments())), 0) - - # XXX: not yet implemented - # self.assertEquals(len(conversation.getThreads()), 0) + self.assertEquals(sum(1 for w in conversation.getThreads()), 0) self.assertEquals(conversation.total_comments, 0) def test_delete_recursive(self):