Functional test for posting a comment with comment review workflow enabled.

svn path=/plone.app.discussion/trunk/; revision=40495
This commit is contained in:
Timo Stollenwerk 2010-10-03 19:07:30 +00:00
parent 603bcf3547
commit ede295e649
1 changed files with 34 additions and 2 deletions

View File

@ -47,12 +47,12 @@ Create a public page with comments allowed.
>>> browser.getControl(name='form.button.save').click()
>>> urldoc1 = browser.url
Check that the form has been properly submitted
>>> browser.url
'http://nohost/plone/doc1'
Comment Viewlet
---------------
@ -192,6 +192,38 @@ Check that the reply has been posted properly.
True
Post a comment with comment review workflow enabled
---------------------------------------------------
Enable the 'comment review workflow' for comments.
>>> portal.portal_workflow.setChainForPortalTypes(('Discussion Item',), ('comment_review_workflow'),)
>>> portal.portal_workflow.getChainForPortalType('Discussion Item')
('comment_review_workflow',)
We need to commit the transaction, otherwise setting the workflow will not work.
>>> import transaction
>>> transaction.commit()
Post comment as anonymous user.
>>> unprivileged_browser.open(urldoc1)
>>> unprivileged_browser.getControl(name='form.widgets.text').value = "Comment review workflow comment"
>>> unprivileged_browser.getControl(name='form.buttons.comment').click()
Make sure the comment has not been published.
>>> 'Comment review workflow comment' not in unprivileged_browser.contents
True
Make sure the user gets a notification that the comment awaits moderator
approval.
>>> 'Your comment awaits moderator approval' in unprivileged_browser.contents
True
Regression Test
---------------