From c8cd370fc9f4c0da3ad12bd634c1bea76853b9b7 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sat, 30 Oct 2010 19:26:51 +0000 Subject: [PATCH] Use len(tuple()) instead of tuple() to make tests pass again. svn path=/plone.app.discussion/trunk/; revision=44706 --- plone/app/discussion/tests/test_comments_viewlet.py | 4 ++-- plone/app/discussion/tests/test_conversation.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plone/app/discussion/tests/test_comments_viewlet.py b/plone/app/discussion/tests/test_comments_viewlet.py index e67881e..e622208 100644 --- a/plone/app/discussion/tests/test_comments_viewlet.py +++ b/plone/app/discussion/tests/test_comments_viewlet.py @@ -242,7 +242,7 @@ class TestCommentsViewlet(PloneTestCase): conversation.addComment(comment) conversation.addComment(comment) replies = self.viewlet.get_replies() - self.assertEquals(tuple(replies), 2) + self.assertEquals(len(tuple(replies)), 2) replies = self.viewlet.get_replies() replies.next() replies.next() @@ -255,7 +255,7 @@ class TestCommentsViewlet(PloneTestCase): conversation = IConversation(self.portal.doc1) c1 = conversation.addComment(comment) self.assertEquals( - tuple(self.viewlet.get_replies(workflow_actions=True)), 1) + len(tuple(self.viewlet.get_replies(workflow_actions=True))), 1) # Enable moderation workflow self.portal.portal_workflow.setChainForPortalTypes( ('Discussion Item',), diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index 94ecfaf..e5060e2 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -54,7 +54,7 @@ class ConversationTest(PloneTestCase): aq_base(conversation)) self.assertEquals(new_id, comment.comment_id) self.assertEquals(len(list(conversation.getComments())), 1) - self.assertEquals(tuple(conversation.getThreads()), 1) + self.assertEquals(len(tuple(conversation.getThreads())), 1) self.assertEquals(conversation.total_comments, 1) self.assert_(conversation.last_comment_date - datetime.utcnow() < timedelta(seconds=1)) @@ -75,7 +75,7 @@ class ConversationTest(PloneTestCase): # make sure the comment has been added self.assertEquals(len(list(conversation.getComments())), 1) - self.assertEquals(tuple(conversation.getThreads()), 1) + self.assertEquals(len(tuple(conversation.getThreads())), 1) self.assertEquals(conversation.total_comments, 1) # delete the comment we just created @@ -83,7 +83,7 @@ class ConversationTest(PloneTestCase): # make sure there is no comment left in the conversation self.assertEquals(len(list(conversation.getComments())), 0) - self.assertEquals(tuple(conversation.getThreads()), 0) + self.assertEquals(len(tuple(conversation.getThreads())), 0) self.assertEquals(conversation.total_comments, 0) def test_delete_recursive(self): @@ -165,7 +165,7 @@ class ConversationTest(PloneTestCase): # Make sure the comment has been deleted as well self.assertEquals(len(list(conversation.getComments())), 0) - self.assertEquals(tuple(conversation.getThreads()), 0) + self.assertEquals(len(tuple(conversation.getThreads())), 0) self.assertEquals(conversation.total_comments, 0) def test_allow_discussion(self):