Remove comment title from comments viewlet tests.
svn path=/plone.app.discussion/trunk/; revision=40496
This commit is contained in:
parent
ede295e649
commit
6d92d1383c
@ -180,7 +180,7 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
|
|||||||
comment.creation_date = comment.modification_date = datetime.utcnow()
|
comment.creation_date = comment.modification_date = datetime.utcnow()
|
||||||
else:
|
else:
|
||||||
raise Unauthorized, "Anonymous user tries to post a comment, but \
|
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
|
# Check if the added comment is a reply to an existing comment
|
||||||
# or just a regular reply to the content object.
|
# or just a regular reply to the content object.
|
||||||
@ -260,8 +260,8 @@ class CommentsViewlet(ViewletBase):
|
|||||||
try:
|
try:
|
||||||
self.get_replies(workflow_actions).next()
|
self.get_replies(workflow_actions).next()
|
||||||
return True
|
return True
|
||||||
except StopIteration:
|
except StopIteration: # pragma: no cover
|
||||||
pass # pragma: no cover
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_replies(self, workflow_actions=False):
|
def get_replies(self, workflow_actions=False):
|
||||||
|
@ -114,8 +114,7 @@ class TestCommentForm(PloneTestCase):
|
|||||||
factory=CommentForm,
|
factory=CommentForm,
|
||||||
name=u"comment-form")
|
name=u"comment-form")
|
||||||
|
|
||||||
request = make_request(form={'form.widgets.title': u'foo',
|
request = make_request(form={'form.widgets.text': u'bar'})
|
||||||
'form.widgets.text': u'bar'})
|
|
||||||
|
|
||||||
commentForm = getMultiAdapter((self.context, request),
|
commentForm = getMultiAdapter((self.context, request),
|
||||||
name=u"comment-form")
|
name=u"comment-form")
|
||||||
@ -151,8 +150,7 @@ class TestCommentForm(PloneTestCase):
|
|||||||
factory=CommentForm,
|
factory=CommentForm,
|
||||||
name=u"comment-form")
|
name=u"comment-form")
|
||||||
|
|
||||||
request = make_request(form={'form.widgets.title': u'foo',
|
request = make_request(form={'form.widgets.text': u'bar'})
|
||||||
'form.widgets.text': u'bar'})
|
|
||||||
|
|
||||||
commentForm = getMultiAdapter((self.context, request),
|
commentForm = getMultiAdapter((self.context, request),
|
||||||
name=u"comment-form")
|
name=u"comment-form")
|
||||||
@ -231,7 +229,6 @@ class TestCommentsViewlet(PloneTestCase):
|
|||||||
def test_has_replies(self):
|
def test_has_replies(self):
|
||||||
self.assertEquals(self.viewlet.has_replies(), False)
|
self.assertEquals(self.viewlet.has_replies(), False)
|
||||||
comment = createObject('plone.Comment')
|
comment = createObject('plone.Comment')
|
||||||
comment.title = 'Comment 1'
|
|
||||||
comment.text = 'Comment text'
|
comment.text = 'Comment text'
|
||||||
conversation = IConversation(self.portal.doc1)
|
conversation = IConversation(self.portal.doc1)
|
||||||
conversation.addComment(comment)
|
conversation.addComment(comment)
|
||||||
@ -240,7 +237,6 @@ class TestCommentsViewlet(PloneTestCase):
|
|||||||
def test_get_replies(self):
|
def test_get_replies(self):
|
||||||
self.failIf(self.viewlet.get_replies())
|
self.failIf(self.viewlet.get_replies())
|
||||||
comment = createObject('plone.Comment')
|
comment = createObject('plone.Comment')
|
||||||
comment.title = 'Comment 1'
|
|
||||||
comment.text = 'Comment text'
|
comment.text = 'Comment text'
|
||||||
conversation = IConversation(self.portal.doc1)
|
conversation = IConversation(self.portal.doc1)
|
||||||
conversation.addComment(comment)
|
conversation.addComment(comment)
|
||||||
@ -255,7 +251,6 @@ class TestCommentsViewlet(PloneTestCase):
|
|||||||
def test_get_replies_with_workflow_actions(self):
|
def test_get_replies_with_workflow_actions(self):
|
||||||
self.failIf(self.viewlet.get_replies(workflow_actions=True))
|
self.failIf(self.viewlet.get_replies(workflow_actions=True))
|
||||||
comment = createObject('plone.Comment')
|
comment = createObject('plone.Comment')
|
||||||
comment.title = 'Comment 1'
|
|
||||||
comment.text = 'Comment text'
|
comment.text = 'Comment text'
|
||||||
conversation = IConversation(self.portal.doc1)
|
conversation = IConversation(self.portal.doc1)
|
||||||
c1 = conversation.addComment(comment)
|
c1 = conversation.addComment(comment)
|
||||||
@ -277,7 +272,6 @@ class TestCommentsViewlet(PloneTestCase):
|
|||||||
|
|
||||||
def test_get_commenter_home_url(self):
|
def test_get_commenter_home_url(self):
|
||||||
comment = createObject('plone.Comment')
|
comment = createObject('plone.Comment')
|
||||||
comment.title = 'Comment 1'
|
|
||||||
comment.text = 'Comment text'
|
comment.text = 'Comment text'
|
||||||
IConversation(self.portal.doc1)
|
IConversation(self.portal.doc1)
|
||||||
portal_membership = getToolByName(self.portal, 'portal_membership')
|
portal_membership = getToolByName(self.portal, 'portal_membership')
|
||||||
@ -303,7 +297,6 @@ class TestCommentsViewlet(PloneTestCase):
|
|||||||
# Add a conversation with a comment
|
# Add a conversation with a comment
|
||||||
conversation = IConversation(self.portal.doc1)
|
conversation = IConversation(self.portal.doc1)
|
||||||
comment = createObject('plone.Comment')
|
comment = createObject('plone.Comment')
|
||||||
comment.title = 'Comment 1'
|
|
||||||
comment.text = 'Comment text'
|
comment.text = 'Comment text'
|
||||||
comment.Creator = 'Jim'
|
comment.Creator = 'Jim'
|
||||||
comment.author_username = 'jim'
|
comment.author_username = 'jim'
|
||||||
@ -329,7 +322,6 @@ class TestCommentsViewlet(PloneTestCase):
|
|||||||
# Add a conversation with a comment
|
# Add a conversation with a comment
|
||||||
conversation = IConversation(self.portal.doc1)
|
conversation = IConversation(self.portal.doc1)
|
||||||
comment = createObject('plone.Comment')
|
comment = createObject('plone.Comment')
|
||||||
comment.title = 'Comment 1'
|
|
||||||
comment.text = 'Comment text'
|
comment.text = 'Comment text'
|
||||||
comment.Creator = 'Jim'
|
comment.Creator = 'Jim'
|
||||||
comment.author_username = 'jim'
|
comment.author_username = 'jim'
|
||||||
|
Loading…
Reference in New Issue
Block a user