Test publish bulk actions as well.
svn path=/plone.app.discussion/trunk/; revision=39943
This commit is contained in:
		
							parent
							
								
									8d866a0ff6
								
							
						
					
					
						commit
						742412a7d8
					
				@ -103,13 +103,10 @@ class ModerationBulkActionsViewTest(PloneTestCase):
 | 
			
		||||
        self.loginAsPortalOwner()
 | 
			
		||||
        typetool = self.portal.portal_types
 | 
			
		||||
        typetool.constructContent('Document', self.portal, 'doc1')
 | 
			
		||||
        
 | 
			
		||||
        self.portal_discussion = getToolByName(self.portal,
 | 
			
		||||
                                               'portal_discussion',
 | 
			
		||||
        self.wf = getToolByName(self.portal, 
 | 
			
		||||
                                'portal_workflow',
 | 
			
		||||
                                None)
 | 
			
		||||
        self.membership_tool = getToolByName(self.folder,
 | 
			
		||||
                                             'portal_membership')
 | 
			
		||||
        self.memberdata = self.portal.portal_memberdata
 | 
			
		||||
        
 | 
			
		||||
        self.request = self.app.REQUEST
 | 
			
		||||
        self.context = self.portal
 | 
			
		||||
        self.portal.portal_workflow.setChainForPortalTypes(
 | 
			
		||||
@ -159,8 +156,19 @@ class ModerationBulkActionsViewTest(PloneTestCase):
 | 
			
		||||
        self.request = self.app.REQUEST
 | 
			
		||||
        self.context = self.portal
 | 
			
		||||
        self.request.set('form.select.BulkAction', 'publish')
 | 
			
		||||
        self.request.set('paths', [])
 | 
			
		||||
        self.request.set('paths', ['/'.join(self.comment1.getPhysicalPath())])        
 | 
			
		||||
        view = BulkActionsView(self.context, self.request)
 | 
			
		||||
        view()
 | 
			
		||||
        
 | 
			
		||||
        # Count published comments
 | 
			
		||||
        published_comments = 0
 | 
			
		||||
        for r in self.conversation.getThreads():
 | 
			
		||||
            comment_obj = r['comment']
 | 
			
		||||
            workflow_status = self.wf.getInfoFor(comment_obj, 'review_state')
 | 
			
		||||
            if workflow_status == 'published':
 | 
			
		||||
                published_comments += 1
 | 
			
		||||
        
 | 
			
		||||
        self.assertEquals(published_comments, 1)
 | 
			
		||||
        
 | 
			
		||||
    def test_mark_as_spam(self):
 | 
			
		||||
        self.request = self.app.REQUEST
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user