Use 'comment_review_workflow' instead of 'simple_publication_workflow' for testing.
svn path=/plone.app.discussion/trunk/; revision=40571
This commit is contained in:
parent
324d2274bd
commit
f7ed357a83
@ -115,9 +115,11 @@ class CommentTest(PloneTestCase):
|
|||||||
str(new_comment1_id), comment.absolute_url())
|
str(new_comment1_id), comment.absolute_url())
|
||||||
|
|
||||||
def test_workflow(self):
|
def test_workflow(self):
|
||||||
|
"""Basic test for the 'comment_review_workflow'
|
||||||
|
"""
|
||||||
self.portal.portal_workflow.setChainForPortalTypes(
|
self.portal.portal_workflow.setChainForPortalTypes(
|
||||||
('Discussion Item',),
|
('Discussion Item',),
|
||||||
('simple_publication_workflow,'))
|
('comment_review_workflow,'))
|
||||||
|
|
||||||
conversation = IConversation(self.portal.doc1)
|
conversation = IConversation(self.portal.doc1)
|
||||||
comment1 = createObject('plone.Comment')
|
comment1 = createObject('plone.Comment')
|
||||||
@ -125,17 +127,17 @@ class CommentTest(PloneTestCase):
|
|||||||
|
|
||||||
comment = conversation[new_comment1_id]
|
comment = conversation[new_comment1_id]
|
||||||
|
|
||||||
|
# Make sure comments use the 'comment_review_workflow'
|
||||||
chain = self.portal.portal_workflow.getChainFor(comment)
|
chain = self.portal.portal_workflow.getChainFor(comment)
|
||||||
self.assertEquals(('simple_publication_workflow',), chain)
|
self.assertEquals(('comment_review_workflow',), chain)
|
||||||
|
|
||||||
# ensure the initial state was entered and recorded
|
# Ensure the initial state was entered and recorded
|
||||||
self.assertEquals(1,
|
self.assertEquals(1,
|
||||||
len(comment.workflow_history['simple_publication_workflow']))
|
len(comment.workflow_history['comment_review_workflow']))
|
||||||
self.assertEquals(None,
|
self.assertEquals(None,
|
||||||
comment.workflow_history['simple_publication_workflow'][0]\
|
comment.workflow_history['comment_review_workflow'][0]\
|
||||||
['action'])
|
['action'])
|
||||||
|
self.assertEquals('pending',
|
||||||
self.assertEquals('private',
|
|
||||||
self.portal.portal_workflow.getInfoFor(comment, 'review_state'))
|
self.portal.portal_workflow.getInfoFor(comment, 'review_state'))
|
||||||
|
|
||||||
def test_fti(self):
|
def test_fti(self):
|
||||||
|
@ -261,7 +261,7 @@ class TestCommentsViewlet(PloneTestCase):
|
|||||||
# Enable moderation workflow
|
# Enable moderation workflow
|
||||||
self.portal.portal_workflow.setChainForPortalTypes(
|
self.portal.portal_workflow.setChainForPortalTypes(
|
||||||
('Discussion Item',),
|
('Discussion Item',),
|
||||||
('simple_publication_workflow,'))
|
('comment_review_workflow,'))
|
||||||
# Check if workflow actions are available
|
# Check if workflow actions are available
|
||||||
reply = self.viewlet.get_replies(workflow_actions=True).next()
|
reply = self.viewlet.get_replies(workflow_actions=True).next()
|
||||||
self.failUnless(reply.has_key('actions'))
|
self.failUnless(reply.has_key('actions'))
|
||||||
|
Loading…
Reference in New Issue
Block a user