From 6d92d1383cf25f37a27d10072edc7962dd13f8f6 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Sun, 3 Oct 2010 19:41:02 +0000 Subject: [PATCH] Remove comment title from comments viewlet tests. svn path=/plone.app.discussion/trunk/; revision=40496 --- plone/app/discussion/browser/comments.py | 6 +++--- plone/app/discussion/tests/test_comments_viewlet.py | 12 ++---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index ddeb5b4..b0fe8db 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -180,7 +180,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form): comment.creation_date = comment.modification_date = datetime.utcnow() else: raise Unauthorized, "Anonymous user tries to post a comment, but \ - anonymous commenting is disabled." + anonymous commenting is disabled." # pragma: no cover # Check if the added comment is a reply to an existing comment # or just a regular reply to the content object. @@ -260,8 +260,8 @@ class CommentsViewlet(ViewletBase): try: self.get_replies(workflow_actions).next() return True - except StopIteration: - pass # pragma: no cover + except StopIteration: # pragma: no cover + pass return False def get_replies(self, workflow_actions=False): diff --git a/plone/app/discussion/tests/test_comments_viewlet.py b/plone/app/discussion/tests/test_comments_viewlet.py index 4788001..5a64024 100644 --- a/plone/app/discussion/tests/test_comments_viewlet.py +++ b/plone/app/discussion/tests/test_comments_viewlet.py @@ -114,8 +114,7 @@ class TestCommentForm(PloneTestCase): factory=CommentForm, name=u"comment-form") - request = make_request(form={'form.widgets.title': u'foo', - 'form.widgets.text': u'bar'}) + request = make_request(form={'form.widgets.text': u'bar'}) commentForm = getMultiAdapter((self.context, request), name=u"comment-form") @@ -151,8 +150,7 @@ class TestCommentForm(PloneTestCase): factory=CommentForm, name=u"comment-form") - request = make_request(form={'form.widgets.title': u'foo', - 'form.widgets.text': u'bar'}) + request = make_request(form={'form.widgets.text': u'bar'}) commentForm = getMultiAdapter((self.context, request), name=u"comment-form") @@ -231,7 +229,6 @@ class TestCommentsViewlet(PloneTestCase): def test_has_replies(self): self.assertEquals(self.viewlet.has_replies(), False) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' conversation = IConversation(self.portal.doc1) conversation.addComment(comment) @@ -240,7 +237,6 @@ class TestCommentsViewlet(PloneTestCase): def test_get_replies(self): self.failIf(self.viewlet.get_replies()) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' conversation = IConversation(self.portal.doc1) conversation.addComment(comment) @@ -255,7 +251,6 @@ class TestCommentsViewlet(PloneTestCase): def test_get_replies_with_workflow_actions(self): self.failIf(self.viewlet.get_replies(workflow_actions=True)) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' conversation = IConversation(self.portal.doc1) c1 = conversation.addComment(comment) @@ -277,7 +272,6 @@ class TestCommentsViewlet(PloneTestCase): def test_get_commenter_home_url(self): comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' IConversation(self.portal.doc1) portal_membership = getToolByName(self.portal, 'portal_membership') @@ -303,7 +297,6 @@ class TestCommentsViewlet(PloneTestCase): # Add a conversation with a comment conversation = IConversation(self.portal.doc1) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' comment.Creator = 'Jim' comment.author_username = 'jim' @@ -329,7 +322,6 @@ class TestCommentsViewlet(PloneTestCase): # Add a conversation with a comment conversation = IConversation(self.portal.doc1) comment = createObject('plone.Comment') - comment.title = 'Comment 1' comment.text = 'Comment text' comment.Creator = 'Jim' comment.author_username = 'jim'