fix tests for conversation.getThreads generator.

svn path=/plone.app.discussion/trunk/; revision=34911
This commit is contained in:
Timo Stollenwerk 2010-03-16 10:52:25 +00:00
parent 4ed9d08119
commit ebc4c408e3

View File

@ -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):