commit
						5c4599a7f3
					
				@ -5,6 +5,7 @@ package-extras = [test]
 | 
			
		||||
parts +=
 | 
			
		||||
    mkrelease
 | 
			
		||||
    pocompile
 | 
			
		||||
    code-analysis
 | 
			
		||||
 | 
			
		||||
[mkrelease]
 | 
			
		||||
recipe = zc.recipe.egg
 | 
			
		||||
@ -14,6 +15,11 @@ eggs = jarn.mkrelease
 | 
			
		||||
recipe = zc.recipe.egg
 | 
			
		||||
eggs = zest.pocompile
 | 
			
		||||
 | 
			
		||||
[code-analysis]
 | 
			
		||||
recipe = plone.recipe.codeanalysis
 | 
			
		||||
directory = ${buildout:directory}/plone/app/discussion
 | 
			
		||||
flake8-max-complexity = 50
 | 
			
		||||
 | 
			
		||||
[versions]
 | 
			
		||||
plone.app.discussion =
 | 
			
		||||
zope.interface = 4.0.5
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,5 @@
 | 
			
		||||
from Products.CMFCore.utils import getToolByName
 | 
			
		||||
 | 
			
		||||
from zope.component import queryUtility
 | 
			
		||||
 | 
			
		||||
from Acquisition import aq_inner, aq_parent
 | 
			
		||||
 | 
			
		||||
from zope.annotation.interfaces import IAnnotations
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,15 @@
 | 
			
		||||
from Products.CMFCore.utils import getToolByName
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def index_object(obj, event):
 | 
			
		||||
    """Index the object when it is added to the conversation.
 | 
			
		||||
    """
 | 
			
		||||
    catalog = getToolByName(obj, 'portal_catalog')
 | 
			
		||||
    return catalog.reindexObject(obj)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def unindex_object(obj, event):
 | 
			
		||||
    """Unindex the object when it is removed from the conversation.
 | 
			
		||||
    """
 | 
			
		||||
    catalog = getToolByName(obj, 'portal_catalog')
 | 
			
		||||
    return catalog.unindexObject(obj)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -19,8 +19,6 @@ from plone.app.discussion.testing import (
 | 
			
		||||
 | 
			
		||||
from plone.app.discussion.interfaces import IConversation
 | 
			
		||||
 | 
			
		||||
from plone.app.discussion.testing import COLLECTION_TYPE
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class CatalogSetupTest(unittest.TestCase):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -308,7 +308,7 @@ class ConversationTest(unittest.TestCase):
 | 
			
		||||
 | 
			
		||||
        # Create a folder
 | 
			
		||||
        self.typetool.constructContent('Folder', self.portal, 'f1')
 | 
			
		||||
        f1 = self.portal.f1
 | 
			
		||||
 | 
			
		||||
        # Usually we don't create a conversation on a folder
 | 
			
		||||
        conversation = self.portal.f1.restrictedTraverse('@@conversation_view')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,8 +1,6 @@
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
import unittest
 | 
			
		||||
 | 
			
		||||
from DateTime import DateTime
 | 
			
		||||
 | 
			
		||||
from zope.component import createObject
 | 
			
		||||
 | 
			
		||||
from Products.CMFCore.utils import getToolByName
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user