Functional test for posting a comment with comment review workflow enabled.
svn path=/plone.app.discussion/trunk/; revision=40495
This commit is contained in:
parent
603bcf3547
commit
ede295e649
@ -47,12 +47,12 @@ Create a public page with comments allowed.
|
|||||||
>>> browser.getControl(name='form.button.save').click()
|
>>> browser.getControl(name='form.button.save').click()
|
||||||
>>> urldoc1 = browser.url
|
>>> urldoc1 = browser.url
|
||||||
|
|
||||||
|
|
||||||
Check that the form has been properly submitted
|
Check that the form has been properly submitted
|
||||||
|
|
||||||
>>> browser.url
|
>>> browser.url
|
||||||
'http://nohost/plone/doc1'
|
'http://nohost/plone/doc1'
|
||||||
|
|
||||||
|
|
||||||
Comment Viewlet
|
Comment Viewlet
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
@ -192,6 +192,38 @@ Check that the reply has been posted properly.
|
|||||||
True
|
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
|
Regression Test
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user