From 3711d2fb5fb9867344f232f4b7dec0175601540f Mon Sep 17 00:00:00 2001 From: Andrea Cecchi Date: Tue, 4 Feb 2014 11:35:20 +0100 Subject: [PATCH] rebased branch from master --- CHANGES.rst | 2 ++ .../app/discussion/tests/test_comments_viewlet.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 27b7716..4ac4976 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -100,6 +100,8 @@ Changelog [toutpt] +======= +>>>>>>> rebased branch from master 2.2.10 (2013-09-24) ------------------- diff --git a/plone/app/discussion/tests/test_comments_viewlet.py b/plone/app/discussion/tests/test_comments_viewlet.py index e469b91..dcf4246 100644 --- a/plone/app/discussion/tests/test_comments_viewlet.py +++ b/plone/app/discussion/tests/test_comments_viewlet.py @@ -196,6 +196,21 @@ class TestCommentForm(unittest.TestCase): comment = [x for x in conversation.getComments()][-1] self.assertEquals(comment.text, u"foobar") + comments = IConversation(commentForm.context).getComments() + comments = [comment for comment in comments] # consume itertor + self.assertEqual(len(comments), 1) + + for comment in comments: + self.assertEqual(comment.text, u"bar") + self.assertEqual(comment.creator, "test-user") + self.assertEqual(comment.getOwner().getUserName(), "test-user") + local_roles = comment.get_local_roles() + self.assertEqual(len(local_roles), 1) + userid, roles = local_roles[0] + self.assertEqual(userid, 'test-user') + self.assertEqual(len(roles), 1) + self.assertEqual(roles[0], 'Owner') + def test_add_anonymous_comment(self): self.portal.doc1.allow_discussion = True