Use 'comment_review_workflow' instead of 'simple_publication_workflow' for testing.

svn path=/plone.app.discussion/trunk/; revision=40571
This commit is contained in:
Timo Stollenwerk 2010-10-08 11:03:14 +00:00
parent 324d2274bd
commit f7ed357a83
2 changed files with 10 additions and 8 deletions

View File

@ -115,9 +115,11 @@ class CommentTest(PloneTestCase):
str(new_comment1_id), comment.absolute_url())
def test_workflow(self):
"""Basic test for the 'comment_review_workflow'
"""
self.portal.portal_workflow.setChainForPortalTypes(
('Discussion Item',),
('simple_publication_workflow,'))
('comment_review_workflow,'))
conversation = IConversation(self.portal.doc1)
comment1 = createObject('plone.Comment')
@ -125,17 +127,17 @@ class CommentTest(PloneTestCase):
comment = conversation[new_comment1_id]
# Make sure comments use the 'comment_review_workflow'
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,
len(comment.workflow_history['simple_publication_workflow']))
len(comment.workflow_history['comment_review_workflow']))
self.assertEquals(None,
comment.workflow_history['simple_publication_workflow'][0]\
comment.workflow_history['comment_review_workflow'][0]\
['action'])
self.assertEquals('private',
self.assertEquals('pending',
self.portal.portal_workflow.getInfoFor(comment, 'review_state'))
def test_fti(self):

View File

@ -261,7 +261,7 @@ class TestCommentsViewlet(PloneTestCase):
# Enable moderation workflow
self.portal.portal_workflow.setChainForPortalTypes(
('Discussion Item',),
('simple_publication_workflow,'))
('comment_review_workflow,'))
# Check if workflow actions are available
reply = self.viewlet.get_replies(workflow_actions=True).next()
self.failUnless(reply.has_key('actions'))