Comment out the discussion control panel event subscriber tests. We disabled this functionality anyway.
svn path=/plone.app.discussion/branches/1.x/; revision=46991
This commit is contained in:
		
							parent
							
								
									2f30c27555
								
							
						
					
					
						commit
						ed4f2b1fa8
					
				@ -99,71 +99,71 @@ class RegistryTest(PloneTestCase):
 | 
			
		||||
    #        'IDiscussionSettings.user_notification_enabled'], False)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ConfigurationChangedSubscriberTest(PloneTestCase):
 | 
			
		||||
 | 
			
		||||
    layer = DiscussionLayer
 | 
			
		||||
 | 
			
		||||
    def afterSetUp(self):
 | 
			
		||||
        self.loginAsPortalOwner()
 | 
			
		||||
        # Set up the registry
 | 
			
		||||
        registry = queryUtility(IRegistry)
 | 
			
		||||
        self.settings = registry.forInterface(IDiscussionSettings, check=False)
 | 
			
		||||
 | 
			
		||||
    def test_moderation_enabled_in_discussion_control_panel_changed(self):
 | 
			
		||||
        """Make sure the 'Discussion Item' workflow is changed properly, when
 | 
			
		||||
           the 'comment_moderation' setting in the discussion control panel
 | 
			
		||||
           changes.
 | 
			
		||||
        """
 | 
			
		||||
        # By default the one_state_workflow without moderation is enabled
 | 
			
		||||
        self.assertEquals(('one_state_workflow',),
 | 
			
		||||
                          self.portal.portal_workflow.getChainForPortalType(
 | 
			
		||||
                              'Discussion Item'))
 | 
			
		||||
 | 
			
		||||
        # Enable moderation in the discussion control panel
 | 
			
		||||
        self.settings.moderation_enabled = True
 | 
			
		||||
 | 
			
		||||
        # Make sure the comment_review_workflow with moderation enabled is
 | 
			
		||||
        # enabled
 | 
			
		||||
        self.assertEquals(('comment_review_workflow',),
 | 
			
		||||
                          self.portal.portal_workflow.getChainForPortalType(
 | 
			
		||||
                              'Discussion Item'))
 | 
			
		||||
        # And back
 | 
			
		||||
        self.settings.moderation_enabled = False
 | 
			
		||||
        self.assertEquals(('one_state_workflow',),
 | 
			
		||||
                          self.portal.portal_workflow.getChainForPortalType(
 | 
			
		||||
                              'Discussion Item'))
 | 
			
		||||
 | 
			
		||||
    def test_change_workflow_in_types_control_panel(self):
 | 
			
		||||
        """Make sure the setting in the discussion control panel is changed
 | 
			
		||||
           accordingly, when the workflow for the 'Discussion Item' changed in
 | 
			
		||||
           the types control panel.
 | 
			
		||||
        """
 | 
			
		||||
        # By default, moderation is disabled
 | 
			
		||||
        self.settings.moderation_enabled = False
 | 
			
		||||
 | 
			
		||||
        # Enable the 'comment_review_workflow' with moderation enabled
 | 
			
		||||
        self.portal.portal_workflow.setChainForPortalTypes(
 | 
			
		||||
            ('Discussion Item',),
 | 
			
		||||
            ('comment_review_workflow',))
 | 
			
		||||
 | 
			
		||||
        # Make sure the moderation_enabled settings has changed
 | 
			
		||||
        self.settings.moderation_enabled = True
 | 
			
		||||
 | 
			
		||||
        # Enable the 'comment_review_workflow' with moderation enabled
 | 
			
		||||
        self.portal.portal_workflow.setChainForPortalTypes(
 | 
			
		||||
            ('Discussion Item',),
 | 
			
		||||
            ('one_state_workflow',))
 | 
			
		||||
        self.settings.moderation_enabled = True
 | 
			
		||||
 | 
			
		||||
        # Enable a 'custom' discussion workflow
 | 
			
		||||
        self.portal.portal_workflow.setChainForPortalTypes(
 | 
			
		||||
            ('Discussion Item',),
 | 
			
		||||
            ('intranet_workflow',))
 | 
			
		||||
 | 
			
		||||
        # Setting has not changed. A Custom workflow disables the
 | 
			
		||||
        # enable_moderation checkbox in the discussion control panel. The
 | 
			
		||||
        # setting itself remains unchanged.
 | 
			
		||||
        self.settings.moderation_enabled = True
 | 
			
		||||
#class ConfigurationChangedSubscriberTest(PloneTestCase):
 | 
			
		||||
#
 | 
			
		||||
#    layer = DiscussionLayer
 | 
			
		||||
#
 | 
			
		||||
#    def afterSetUp(self):
 | 
			
		||||
#        self.loginAsPortalOwner()
 | 
			
		||||
#        # Set up the registry
 | 
			
		||||
#        registry = queryUtility(IRegistry)
 | 
			
		||||
#        self.settings = registry.forInterface(IDiscussionSettings, check=False)
 | 
			
		||||
#
 | 
			
		||||
#    def test_moderation_enabled_in_discussion_control_panel_changed(self):
 | 
			
		||||
#        """Make sure the 'Discussion Item' workflow is changed properly, when
 | 
			
		||||
#           the 'comment_moderation' setting in the discussion control panel
 | 
			
		||||
#           changes.
 | 
			
		||||
#        """
 | 
			
		||||
#        # By default the one_state_workflow without moderation is enabled
 | 
			
		||||
#        self.assertEquals(('one_state_workflow',),
 | 
			
		||||
#                          self.portal.portal_workflow.getChainForPortalType(
 | 
			
		||||
#                              'Discussion Item'))
 | 
			
		||||
#
 | 
			
		||||
#        # Enable moderation in the discussion control panel
 | 
			
		||||
#        self.settings.moderation_enabled = True
 | 
			
		||||
#
 | 
			
		||||
#        # Make sure the comment_review_workflow with moderation enabled is
 | 
			
		||||
#        # enabled
 | 
			
		||||
#        self.assertEquals(('comment_review_workflow',),
 | 
			
		||||
#                          self.portal.portal_workflow.getChainForPortalType(
 | 
			
		||||
#                              'Discussion Item'))
 | 
			
		||||
#        # And back
 | 
			
		||||
#        self.settings.moderation_enabled = False
 | 
			
		||||
#        self.assertEquals(('one_state_workflow',),
 | 
			
		||||
#                          self.portal.portal_workflow.getChainForPortalType(
 | 
			
		||||
#                              'Discussion Item'))
 | 
			
		||||
#
 | 
			
		||||
#    def test_change_workflow_in_types_control_panel(self):
 | 
			
		||||
#        """Make sure the setting in the discussion control panel is changed
 | 
			
		||||
#           accordingly, when the workflow for the 'Discussion Item' changed in
 | 
			
		||||
#           the types control panel.
 | 
			
		||||
#        """
 | 
			
		||||
#        # By default, moderation is disabled
 | 
			
		||||
#        self.settings.moderation_enabled = False
 | 
			
		||||
#
 | 
			
		||||
#        # Enable the 'comment_review_workflow' with moderation enabled
 | 
			
		||||
#        self.portal.portal_workflow.setChainForPortalTypes(
 | 
			
		||||
#            ('Discussion Item',),
 | 
			
		||||
#            ('comment_review_workflow',))
 | 
			
		||||
#
 | 
			
		||||
#        # Make sure the moderation_enabled settings has changed
 | 
			
		||||
#        self.settings.moderation_enabled = True
 | 
			
		||||
#
 | 
			
		||||
#        # Enable the 'comment_review_workflow' with moderation enabled
 | 
			
		||||
#        self.portal.portal_workflow.setChainForPortalTypes(
 | 
			
		||||
#            ('Discussion Item',),
 | 
			
		||||
#            ('one_state_workflow',))
 | 
			
		||||
#        self.settings.moderation_enabled = True
 | 
			
		||||
#
 | 
			
		||||
#        # Enable a 'custom' discussion workflow
 | 
			
		||||
#        self.portal.portal_workflow.setChainForPortalTypes(
 | 
			
		||||
#            ('Discussion Item',),
 | 
			
		||||
#            ('intranet_workflow',))
 | 
			
		||||
#
 | 
			
		||||
#        # Setting has not changed. A Custom workflow disables the
 | 
			
		||||
#        # enable_moderation checkbox in the discussion control panel. The
 | 
			
		||||
#        # setting itself remains unchanged.
 | 
			
		||||
#        self.settings.moderation_enabled = True
 | 
			
		||||
 | 
			
		||||
def test_suite():
 | 
			
		||||
    return unittest.defaultTestLoader.loadTestsFromName(__name__)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user