Removing hard coded publish action. evilbungle branch merge.

svn path=/plone.app.discussion/trunk/; revision=30669
This commit is contained in:
Timo Stollenwerk 2009-10-17 16:14:44 +00:00
parent 7ef2672e5c
commit 8db9c8c175
2 changed files with 3 additions and 4 deletions

View File

@ -118,8 +118,7 @@ class PublishComment(BrowserView):
comment = aq_inner(self.context) comment = aq_inner(self.context)
comment_id = self.context.id comment_id = self.context.id
#workflow_action = self.request.form['workflow_action'] workflow_action = self.request.form['workflow_action']
workflow_action = 'publish'
portal_workflow = getToolByName(comment, 'portal_workflow') portal_workflow = getToolByName(comment, 'portal_workflow')
portal_workflow.doActionFor(comment, workflow_action) portal_workflow.doActionFor(comment, workflow_action)

View File

@ -95,7 +95,7 @@ class TestCommentOperations(PloneTestCase):
def test_publish(self): def test_publish(self):
self.portal.REQUEST.form['comment_id'] = self.comment_id self.portal.REQUEST.form['comment_id'] = self.comment_id
self.portal.REQUEST.form['action'] = 'publish' self.portal.REQUEST.form['workflow_action'] = 'publish'
self.assertEquals('pending', self.portal.portal_workflow.getInfoFor(self.comment, 'review_state')) self.assertEquals('pending', self.portal.portal_workflow.getInfoFor(self.comment, 'review_state'))
view = self.comment.restrictedTraverse('@@moderate-publish-comment') view = self.comment.restrictedTraverse('@@moderate-publish-comment')
view() view()
@ -104,7 +104,7 @@ class TestCommentOperations(PloneTestCase):
def test_publish_as_anonymous(self): def test_publish_as_anonymous(self):
self.logout() self.logout()
self.portal.REQUEST.form['comment_id'] = self.comment_id self.portal.REQUEST.form['comment_id'] = self.comment_id
self.portal.REQUEST.form['action'] = 'publish' self.portal.REQUEST.form['workflow_action'] = 'publish'
self.assertEquals('pending', self.portal.portal_workflow.getInfoFor(self.comment, 'review_state')) self.assertEquals('pending', self.portal.portal_workflow.getInfoFor(self.comment, 'review_state'))
self.assertRaises(Unauthorized, self.assertRaises(Unauthorized,
self.comment.restrictedTraverse, self.comment.restrictedTraverse,