Sort imports

Remove unused ones as well.
This commit is contained in:
Gil Forcada 2015-05-03 08:16:39 +02:00
parent ad5f8f6089
commit 4bc77a2831
32 changed files with 273 additions and 399 deletions

View File

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from zope.i18nmessageid import MessageFactory from zope.i18nmessageid import MessageFactory
PloneAppDiscussionMessageFactory = MessageFactory('plone.app.discussion') PloneAppDiscussionMessageFactory = MessageFactory('plone.app.discussion')

View File

@ -1,30 +1,20 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Captcha validator, see captcha.txt for design notes. # Captcha validator, see captcha.txt for design notes.
from persistent import Persistent from persistent import Persistent
from Products.CMFCore.utils import getToolByName
from z3c.form import interfaces
from z3c.form.field import Fields
from zope import interface
from zope.annotation import factory
from zope.component import adapts, queryUtility
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
from zope.interface import Interface
from plone.registry.interfaces import IRegistry
from plone.z3cform.fieldsets import extensible
from plone.app.discussion.browser.comments import CommentForm from plone.app.discussion.browser.comments import CommentForm
from plone.app.discussion.comment import Comment from plone.app.discussion.comment import Comment
from plone.app.discussion.interfaces import IDiscussionSettings, ICaptcha from plone.app.discussion.interfaces import ICaptcha
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.registry.interfaces import IRegistry
from plone.z3cform.fieldsets import extensible
from Products.CMFCore.utils import getToolByName
from z3c.form import interfaces
from z3c.form.field import Fields
from zope import interface
from zope.annotation import factory
from zope.component import adapts, queryUtility
from zope.interface import Interface
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
class Captcha(Persistent): class Captcha(Persistent):

View File

@ -1,15 +1,14 @@
from Acquisition import aq_inner, aq_parent
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from Acquisition import aq_inner
from zope.component import getMultiAdapter from Acquisition import aq_parent
from Products.statusmessages.interfaces import IStatusMessage
from Products.Five.browser import BrowserView
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from plone.app.discussion import PloneAppDiscussionMessageFactory as _ from Products.statusmessages.interfaces import IStatusMessage
from comments import CommentForm from comments import CommentForm
from z3c.form import button from plone.app.discussion import PloneAppDiscussionMessageFactory as _
from plone.z3cform.layout import wrap_form from plone.z3cform.layout import wrap_form
from z3c.form import button
from zope.component import getMultiAdapter
class View(BrowserView): class View(BrowserView):

View File

@ -1,47 +1,37 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from Acquisition import aq_inner
from AccessControl import Unauthorized
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from AccessControl import Unauthorized
from datetime import datetime from Acquisition import aq_inner
from DateTime import DateTime from DateTime import DateTime
from urllib import quote as url_quote
from zope.i18n import translate
from zope.i18nmessageid import Message
from zope.component import createObject, queryUtility
from zope.interface import alsoProvides
from z3c.form import form, field, button, interfaces
from z3c.form.interfaces import IFormLayer
from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.statusmessages.interfaces import IStatusMessage from Products.statusmessages.interfaces import IStatusMessage
from datetime import datetime
from plone.registry.interfaces import IRegistry
from plone.app.layout.viewlets.common import ViewletBase
from plone.app.discussion import PloneAppDiscussionMessageFactory as _ from plone.app.discussion import PloneAppDiscussionMessageFactory as _
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IComment
from plone.app.discussion.interfaces import IReplies
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.interfaces import ICaptcha
from plone.app.discussion.browser.validator import CaptchaValidator from plone.app.discussion.browser.validator import CaptchaValidator
from plone.app.discussion.interfaces import ICaptcha
from plone.app.discussion.interfaces import IComment
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.interfaces import IReplies
from plone.app.layout.viewlets.common import ViewletBase
from plone.registry.interfaces import IRegistry
from plone.z3cform import z2 from plone.z3cform import z2
from plone.z3cform.fieldsets import extensible from plone.z3cform.fieldsets import extensible
from plone.z3cform.interfaces import IWrappedForm from plone.z3cform.interfaces import IWrappedForm
from urllib import quote as url_quote
from z3c.form import button
from z3c.form import field
from z3c.form import form
from z3c.form import interfaces
from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
from z3c.form.interfaces import IFormLayer
from zope.component import createObject
from zope.component import queryUtility
from zope.i18n import translate
from zope.i18nmessageid import Message
from zope.interface import alsoProvides
COMMENT_DESCRIPTION_PLAIN_TEXT = _( COMMENT_DESCRIPTION_PLAIN_TEXT = _(
u"comment_description_plain_text", u"comment_description_plain_text",

View File

@ -1,28 +1,22 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from zope.component import getUtility
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.interfaces._content import IDiscussionResponse from Products.CMFCore.interfaces._content import IDiscussionResponse
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces.controlpanel import IMailSchema from Products.CMFPlone.interfaces.controlpanel import IMailSchema
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.statusmessages.interfaces import IStatusMessage from Products.statusmessages.interfaces import IStatusMessage
from plone.app.controlpanel.interfaces import IConfigurationChangedEvent from plone.app.controlpanel.interfaces import IConfigurationChangedEvent
from plone.app.discussion.interfaces import _
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.upgrades import update_registry
from plone.app.registry.browser import controlpanel from plone.app.registry.browser import controlpanel
from plone.registry.interfaces import IRegistry
from plone.registry.interfaces import IRecordModifiedEvent from plone.registry.interfaces import IRecordModifiedEvent
from plone.registry.interfaces import IRegistry
from zope.component.hooks import getSite
from zope.component import getMultiAdapter, queryUtility
from z3c.form import button from z3c.form import button
from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
from zope.component import getMultiAdapter
from plone.app.discussion.interfaces import IDiscussionSettings, _ from zope.component import getUtility
from plone.app.discussion.upgrades import update_registry from zope.component import queryUtility
from zope.component.hooks import getSite
class DiscussionSettingsEditForm(controlpanel.RegistryEditForm): class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):

View File

@ -1,18 +1,13 @@
from zope.component import queryUtility
from plone.registry.interfaces import IRegistry
from Acquisition import aq_base from Acquisition import aq_base
from Acquisition import aq_chain from Acquisition import aq_chain
from Acquisition import aq_inner from Acquisition import aq_inner
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.interfaces import IFolderish from Products.CMFCore.interfaces import IFolderish
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces import IPloneSiteRoot
from Products.CMFPlone.interfaces import INonStructuralFolder from Products.CMFPlone.interfaces import INonStructuralFolder
from Products.CMFPlone.interfaces import IPloneSiteRoot
from plone.app.discussion.interfaces import IDiscussionSettings from plone.app.discussion.interfaces import IDiscussionSettings
from plone.registry.interfaces import IRegistry
from zope.component import queryUtility
try: try:
from plone.dexterity.interfaces import IDexterityContent from plone.dexterity.interfaces import IDexterityContent

View File

@ -1,22 +1,16 @@
from datetime import datetime from Acquisition import aq_inner
from Acquisition import aq_parent
from Acquisition import aq_inner, aq_parent from DateTime import DateTime
from Products.Five.browser import BrowserView
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.interfaces._content import IDiscussionResponse from Products.CMFCore.interfaces._content import IDiscussionResponse
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from datetime import datetime
from plone.app.discussion.comment import CommentFactory
from plone.app.discussion.interfaces import IConversation, IReplies, IComment
from types import TupleType
import transaction import transaction
from plone.app.discussion.comment import CommentFactory
from plone.app.discussion.interfaces import IConversation, IReplies, IComment
from types import TupleType
from DateTime import DateTime
def DT2dt(DT): def DT2dt(DT):
"""Convert a Zope DateTime (with timezone) into a Python datetime (GMT).""" """Convert a Zope DateTime (with timezone) into a Python datetime (GMT)."""

View File

@ -1,19 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from Acquisition import aq_inner, aq_parent from AccessControl import Unauthorized
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from zope.component import queryUtility from Acquisition import aq_inner
from Acquisition import aq_parent
from AccessControl import Unauthorized, getSecurityManager from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView from Products.Five.browser import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.CMFCore.utils import getToolByName
from Products.statusmessages.interfaces import IStatusMessage from Products.statusmessages.interfaces import IStatusMessage
from plone.registry.interfaces import IRegistry
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.interfaces import _ from plone.app.discussion.interfaces import _
from plone.app.discussion.interfaces import IComment from plone.app.discussion.interfaces import IComment
from plone.app.discussion.interfaces import IReplies from plone.app.discussion.interfaces import IReplies

View File

@ -2,14 +2,14 @@
IDiscussion container for the context, from which traversal will continue IDiscussion container for the context, from which traversal will continue
into an actual comment object. into an actual comment object.
""" """
from zope.interface import Interface, implements
from zope.component import adapts, queryAdapter
from zope.traversing.interfaces import ITraversable, TraversalError
from zope.publisher.interfaces.browser import IBrowserRequest
from plone.app.discussion.interfaces import IConversation from plone.app.discussion.interfaces import IConversation
from zope.component import adapts
from zope.component import queryAdapter
from zope.interface import implements
from zope.interface import Interface
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.traversing.interfaces import ITraversable
from zope.traversing.interfaces import TraversalError
class ConversationNamespace(object): class ConversationNamespace(object):

View File

@ -1,25 +1,20 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""Captcha validator, see captcha.txt for design notes. """Captcha validator, see captcha.txt for design notes.
""" """
from Acquisition import aq_inner from Acquisition import aq_inner
from z3c.form import validator
from z3c.form.interfaces import IValidator
from zope.component import getMultiAdapter, queryUtility
from zope.interface import implements, Interface
from zope.schema.interfaces import IField
from zope.component import adapts
from plone.registry.interfaces import IRegistry
from plone.app.discussion.interfaces import ICaptcha from plone.app.discussion.interfaces import ICaptcha
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.interfaces import IDiscussionLayer from plone.app.discussion.interfaces import IDiscussionLayer
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.registry.interfaces import IRegistry
from z3c.form import validator
from z3c.form.interfaces import IValidator
from zope.component import adapts
from zope.component import getMultiAdapter
from zope.component import queryUtility
from zope.interface import implements
from zope.interface import Interface
from zope.schema.interfaces import IField
try: try:
from collective.z3cform.norobots.validator import WrongNorobotsAnswer from collective.z3cform.norobots.validator import WrongNorobotsAnswer

View File

@ -3,22 +3,14 @@ indexes with values based on the IComment interface.
Also provide event handlers to actually catalog the comments. Also provide event handlers to actually catalog the comments.
""" """
from string import join
from DateTime import DateTime from DateTime import DateTime
from Products.CMFCore.interfaces import IContentish from Products.CMFCore.interfaces import IContentish
from Products.CMFPlone.utils import safe_unicode from Products.CMFPlone.utils import safe_unicode
from Products.ZCatalog.interfaces import IZCatalog from Products.ZCatalog.interfaces import IZCatalog
from plone.app.discussion.interfaces import IConversation, IComment from plone.app.discussion.interfaces import IConversation, IComment
from plone.indexer import indexer from plone.indexer import indexer
from plone.uuid.interfaces import IUUID from plone.uuid.interfaces import IUUID
from string import join
MAX_DESCRIPTION = 25 MAX_DESCRIPTION = 25

View File

@ -1,57 +1,43 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""The default comment class and factory. """The default comment class and factory.
""" """
from AccessControl import ClassSecurityInfo
import logging from AccessControl.SecurityManagement import getSecurityManager
from Acquisition import Implicit
from datetime import datetime from Acquisition import aq_base
from Acquisition import aq_parent
from smtplib import SMTPException from Products.CMFCore import permissions
from Products.CMFCore.CMFCatalogAware import CatalogAware
from zope.annotation.interfaces import IAnnotatable from Products.CMFCore.CMFCatalogAware import WorkflowAware
from zope.component import getUtility
from zope.event import notify
from zope.component.factory import Factory
from zope.component import queryUtility
from zope.i18n import translate
from zope.i18nmessageid import Message
from zope.interface import implements
from Acquisition import aq_parent, aq_base, Implicit
from OFS.owner import Owned
from persistent import Persistent
from Products.CMFCore.DynamicType import DynamicType from Products.CMFCore.DynamicType import DynamicType
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces.controlpanel import IMailSchema
from Products.CMFPlone.utils import safe_unicode from Products.CMFPlone.utils import safe_unicode
from datetime import datetime
from OFS.owner import Owned
from OFS.role import RoleManager
from OFS.Traversable import Traversable from OFS.Traversable import Traversable
from persistent import Persistent
from plone.app.discussion import PloneAppDiscussionMessageFactory as _
from plone.app.discussion.events import CommentAddedEvent from plone.app.discussion.events import CommentAddedEvent
from plone.app.discussion.events import CommentRemovedEvent from plone.app.discussion.events import CommentRemovedEvent
from plone.app.discussion.events import ReplyAddedEvent from plone.app.discussion.events import ReplyAddedEvent
from plone.app.discussion.events import ReplyRemovedEvent from plone.app.discussion.events import ReplyRemovedEvent
from plone.app.discussion import PloneAppDiscussionMessageFactory as _
from plone.app.discussion.interfaces import IComment from plone.app.discussion.interfaces import IComment
from plone.app.discussion.interfaces import IConversation from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IDiscussionSettings from plone.app.discussion.interfaces import IDiscussionSettings
from plone.registry.interfaces import IRegistry from plone.registry.interfaces import IRegistry
from smtplib import SMTPException
from zope.annotation.interfaces import IAnnotatable
from zope.component import getUtility
from zope.component import queryUtility
from zope.component.factory import Factory
from zope.event import notify
from zope.i18n import translate
from zope.i18nmessageid import Message
from zope.interface import implements
from Products.CMFCore.CMFCatalogAware import CatalogAware import logging
from Products.CMFCore.CMFCatalogAware import WorkflowAware
from Products.CMFPlone.interfaces.controlpanel import IMailSchema
from OFS.role import RoleManager
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from Products.CMFCore import permissions
COMMENT_TITLE = _( COMMENT_TITLE = _(

View File

@ -1,12 +1,12 @@
""" Custom discussion events """ Custom discussion events
""" """
from zope.interface import implements
from plone.app.discussion.interfaces import IComment
from plone.app.discussion.interfaces import IDiscussionEvent
from plone.app.discussion.interfaces import ICommentAddedEvent from plone.app.discussion.interfaces import ICommentAddedEvent
from plone.app.discussion.interfaces import ICommentRemovedEvent from plone.app.discussion.interfaces import ICommentRemovedEvent
from plone.app.discussion.interfaces import IDiscussionEvent
from plone.app.discussion.interfaces import IReplyAddedEvent from plone.app.discussion.interfaces import IReplyAddedEvent
from plone.app.discussion.interfaces import IReplyRemovedEvent from plone.app.discussion.interfaces import IReplyRemovedEvent
from zope.interface import implements
class DiscussionEvent(object): class DiscussionEvent(object):
""" Custom event """ Custom event

View File

@ -1,13 +1,11 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""Interfaces for plone.app.discussion """Interfaces for plone.app.discussion
""" """
from plone.app.discussion import PloneAppDiscussionMessageFactory as _
from zope import schema
from zope.component.interfaces import IObjectEvent
from zope.interface import Interface from zope.interface import Interface
from zope.interface.common.mapping import IIterableMapping from zope.interface.common.mapping import IIterableMapping
from zope.component.interfaces import IObjectEvent
from zope import schema
from plone.app.discussion import PloneAppDiscussionMessageFactory as _
class IConversation(IIterableMapping): class IConversation(IIterableMapping):

View File

@ -1,13 +1,10 @@
from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Acquisition import aq_inner, aq_parent
from zope.annotation.interfaces import IAnnotations
from Products.CMFPlone.utils import base_hasattr from Products.CMFPlone.utils import base_hasattr
from Products.CMFPlone.utils import safe_callable from Products.CMFPlone.utils import safe_callable
from plone.app.discussion.conversation import ANNOTATION_KEY from plone.app.discussion.conversation import ANNOTATION_KEY
from zope.annotation.interfaces import IAnnotations
def patchedClearFindAndRebuild(self): def patchedClearFindAndRebuild(self):

View File

@ -1,3 +1,4 @@
from Products.CMFCore.utils import getToolByName
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE
from plone.app.discussion.interfaces import IDiscussionSettings from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.robotframework.testing import REMOTE_LIBRARY_ROBOT_TESTING from plone.app.robotframework.testing import REMOTE_LIBRARY_ROBOT_TESTING
@ -8,7 +9,6 @@ from plone.app.testing import PloneSandboxLayer
from plone.app.testing import setRoles from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID from plone.app.testing import TEST_USER_ID
from plone.registry.interfaces import IRegistry from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zope.component import queryUtility from zope.component import queryUtility
from zope.configuration import xmlconfig from zope.configuration import xmlconfig

View File

@ -1,23 +1,16 @@
"""Test the plone.app.discussion catalog indexes """Test the plone.app.discussion catalog indexes
""" """
import unittest2 as unittest from Products.CMFCore.utils import getToolByName
from datetime import datetime
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from zope.annotation.interfaces import IAnnotations
from zope.component import createObject
import transaction import transaction
import unittest2 as unittest
from datetime import datetime
from zope.component import createObject
from zope.annotation.interfaces import IAnnotations
from Products.CMFCore.utils import getToolByName
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.discussion.testing import (
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
)
from plone.app.discussion.interfaces import IConversation
class CatalogSetupTest(unittest.TestCase): class CatalogSetupTest(unittest.TestCase):

View File

@ -1,24 +1,18 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import datetime from Products.CMFCore.utils import getToolByName
from plone.app.discussion.browser.comment import View
import logging from plone.app.discussion.interfaces import IComment
from plone.app.discussion.interfaces import IConversation
import unittest2 as unittest from plone.app.discussion.interfaces import IReplies
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from zope.component import createObject from zope.component import createObject
from zope.component import getMultiAdapter from zope.component import getMultiAdapter
from Products.CMFCore.utils import getToolByName import datetime
import logging
from plone.app.testing import TEST_USER_ID, setRoles import unittest2 as unittest
from plone.app.discussion.testing import \
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
from plone.app.discussion.interfaces import IComment, IConversation, IReplies
from plone.app.discussion.browser.comment import View
logger = logging.getLogger('plone.app.discussion.tests') logger = logging.getLogger('plone.app.discussion.tests')

View File

@ -1,46 +1,36 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest2 as unittest
import time
from datetime import datetime
from AccessControl import Unauthorized from AccessControl import Unauthorized
from datetime import datetime
from OFS.Image import Image from OFS.Image import Image
from Products.CMFCore.utils import getToolByName
from zope import interface from Products.CMFPlone.tests import dummy
from zope.interface import alsoProvides from plone.app.discussion import interfaces
from zope.publisher.browser import TestRequest from plone.app.discussion.browser.comment import EditCommentForm
from zope.annotation.interfaces import IAttributeAnnotatable from plone.app.discussion.browser.comments import CommentForm
from plone.app.discussion.browser.comments import CommentsViewlet
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import login
from plone.app.testing import logout
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.app.testing import TEST_USER_NAME
from plone.registry.interfaces import IRegistry
from z3c.form.interfaces import IFormLayer from z3c.form.interfaces import IFormLayer
from zope import interface
from zope.annotation.interfaces import IAttributeAnnotatable
from zope.component import createObject
from zope.component import getMultiAdapter
from zope.component import provideAdapter from zope.component import provideAdapter
from zope.component import queryUtility
from zope.interface import alsoProvides
from zope.interface import Interface
from zope.publisher.browser import TestRequest
from zope.publisher.interfaces.browser import IBrowserRequest from zope.publisher.interfaces.browser import IBrowserRequest
from zope.interface import Interface import time
from zope.component import getMultiAdapter import unittest2 as unittest
from zope.component import createObject, queryUtility
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.tests import dummy
from plone.app.testing import TEST_USER_ID, TEST_USER_NAME, setRoles
from plone.app.testing import logout
from plone.app.testing import login
from plone.app.discussion.browser.comments import CommentsViewlet
from plone.app.discussion.browser.comments import CommentForm
from plone.app.discussion.browser.comment import EditCommentForm
from plone.app.discussion import interfaces
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.testing import (
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
)
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.interfaces import IConversation
class TestCommentForm(unittest.TestCase): class TestCommentForm(unittest.TestCase):

View File

@ -1,21 +1,19 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest2 as unittest
from zope.component import createObject, getAdapter
from plone.app.testing import TEST_USER_ID, setRoles
from plone.contentrules.rule.interfaces import IRuleEventType
from plone.stringinterp.interfaces import IStringSubstitution
from plone.app.discussion.interfaces import IConversation, IReplies
from plone.app.discussion.interfaces import ICommentAddedEvent from plone.app.discussion.interfaces import ICommentAddedEvent
from plone.app.discussion.interfaces import ICommentRemovedEvent from plone.app.discussion.interfaces import ICommentRemovedEvent
from plone.app.discussion.interfaces import IConversation, IReplies
from plone.app.discussion.interfaces import IReplyAddedEvent from plone.app.discussion.interfaces import IReplyAddedEvent
from plone.app.discussion.interfaces import IReplyRemovedEvent from plone.app.discussion.interfaces import IReplyRemovedEvent
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.contentrules.rule.interfaces import IRuleEventType
from plone.stringinterp.interfaces import IStringSubstitution
from zope.component import createObject
from zope.component import getAdapter
import unittest2 as unittest
from plone.app.discussion.testing import (
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
)
class CommentContentRulesTest(unittest.TestCase): class CommentContentRulesTest(unittest.TestCase):
""" Test custom comments events """ Test custom comments events

View File

@ -1,19 +1,15 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest2 as unittest from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.registry import Registry
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zope.component import getMultiAdapter from zope.component import getMultiAdapter
from zope.component import queryUtility from zope.component import queryUtility
from plone.registry import Registry import unittest2 as unittest
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.testing import \
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
class RegistryTest(unittest.TestCase): class RegistryTest(unittest.TestCase):

View File

@ -1,29 +1,25 @@
import unittest2 as unittest from Acquisition import aq_base
from datetime import datetime, timedelta from Acquisition import aq_parent
from zope import interface
from zope.component import createObject, queryUtility
from zope.annotation.interfaces import IAnnotations
from Acquisition import aq_base, aq_parent
from plone.app.vocabularies.types import BAD_TYPES
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from datetime import datetime
from plone.app.testing import TEST_USER_ID, setRoles from datetime import timedelta
from plone.app.discussion.testing import (
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
)
from plone.app.discussion import interfaces from plone.app.discussion import interfaces
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IComment from plone.app.discussion.interfaces import IComment
from plone.app.discussion.interfaces import IReplies from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IDiscussionSettings from plone.app.discussion.interfaces import IDiscussionSettings
from plone.app.discussion.interfaces import IReplies
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.app.vocabularies.types import BAD_TYPES
from plone.registry.interfaces import IRegistry
from zope import interface
from zope.annotation.interfaces import IAnnotations
from zope.component import createObject
from zope.component import queryUtility
import unittest2 as unittest
try: try:
from plone.dexterity.interfaces import IDexterityContent from plone.dexterity.interfaces import IDexterityContent

View File

@ -1,17 +1,21 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest2 as unittest
from zope.component import createObject
from Zope2.App import zcml from Zope2.App import zcml
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IReplies
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from zope.component import createObject
import Products.Five import Products.Five
from plone.app.testing import TEST_USER_ID, setRoles import unittest2 as unittest
from plone.app.discussion.interfaces import IConversation, IReplies
from plone.app.discussion.testing import (
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
)
# #
# Fake events registry # Fake events registry
# #
class EventsRegistry(object): class EventsRegistry(object):
""" Fake registry to be used while testing discussion events """ Fake registry to be used while testing discussion events
""" """

View File

@ -3,15 +3,12 @@
These test are only triggered when Plone 4 (and plone.testing) is installed. These test are only triggered when Plone 4 (and plone.testing) is installed.
""" """
import doctest from plone.app.discussion.testing import PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING # noqa
import unittest2 as unittest
import pprint
from plone.testing import layered from plone.testing import layered
from plone.app.discussion.testing import \ import doctest
PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING import pprint
import unittest2 as unittest
optionflags = ( optionflags = (

View File

@ -1,23 +1,17 @@
"""Test for the plone.app.discussion indexers """Test for the plone.app.discussion indexers
""" """
from DateTime import DateTime
from datetime import datetime
from plone.app.discussion import catalog
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from plone.indexer.delegate import DelegatingIndexerFactory
from zope.component import createObject
import unittest2 as unittest import unittest2 as unittest
from datetime import datetime
from DateTime import DateTime
from zope.component import createObject
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.discussion.testing import \
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
from plone.app.discussion.interfaces import IConversation
from plone.indexer.delegate import DelegatingIndexerFactory
from plone.app.discussion import catalog
LONG_TEXT = """Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed LONG_TEXT = """Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,

View File

@ -1,18 +1,14 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest from Products.CMFCore.utils import getToolByName
from plone.app.discussion.browser.moderation import BulkActionsView
from plone.app.discussion.browser.moderation import View
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from zope.component import createObject from zope.component import createObject
from Products.CMFCore.utils import getToolByName import unittest
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.discussion.testing import\
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
from plone.app.discussion.browser.moderation import View
from plone.app.discussion.browser.moderation import BulkActionsView
from plone.app.discussion.interfaces import IConversation
class ModerationViewTest(unittest.TestCase): class ModerationViewTest(unittest.TestCase):

View File

@ -1,25 +1,19 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest2 as unittest
from Acquisition import aq_base from Acquisition import aq_base
from Products.CMFPlone.interfaces import IMailSchema
from Products.CMFPlone.tests.utils import MockMailHost
from Products.MailHost.interfaces import IMailHost
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import TEST_USER_ID
from plone.app.testing import setRoles
from plone.registry.interfaces import IRegistry
from zope.component import createObject from zope.component import createObject
from zope.component import getSiteManager from zope.component import getSiteManager
from zope.component import queryUtility
from zope.component import getUtility from zope.component import getUtility
from zope.component import queryUtility
from plone.app.testing import TEST_USER_ID, setRoles import unittest2 as unittest
from Products.MailHost.interfaces import IMailHost
from Products.CMFPlone.tests.utils import MockMailHost
from Products.CMFPlone.interfaces import IMailSchema
from plone.registry.interfaces import IRegistry
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.testing import\
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
class TestUserNotificationUnit(unittest.TestCase): class TestUserNotificationUnit(unittest.TestCase):

View File

@ -1,9 +1,10 @@
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_ROBOT_TESTING from plone.app.discussion.testing import PLONE_APP_DISCUSSION_ROBOT_TESTING
from plone.app.testing import ROBOT_TEST_LEVEL from plone.app.testing import ROBOT_TEST_LEVEL
from plone.testing import layered from plone.testing import layered
import os import os
import unittest
import robotsuite import robotsuite
import unittest
def test_suite(): def test_suite():

View File

@ -1,23 +1,20 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""Test plone.app.discussion workflow and permissions. """Test plone.app.discussion workflow and permissions.
""" """
import unittest2 as unittest from AccessControl import Unauthorized
from Products.CMFCore.permissions import View
from Products.CMFCore.utils import _checkPermission as checkPerm
from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.interfaces import IDiscussionLayer
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
from plone.app.testing import login
from plone.app.testing import logout
from plone.app.testing import setRoles
from plone.app.testing import TEST_USER_ID
from zope.component import createObject from zope.component import createObject
from zope.interface import alsoProvides from zope.interface import alsoProvides
from AccessControl import Unauthorized import unittest2 as unittest
from Products.CMFCore.utils import _checkPermission as checkPerm
from Products.CMFCore.permissions import View
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.testing import logout, login
from plone.app.discussion.testing import \
PLONE_APP_DISCUSSION_INTEGRATION_TESTING
from plone.app.discussion.interfaces import IConversation, IDiscussionLayer
class WorkflowSetupTest(unittest.TestCase): class WorkflowSetupTest(unittest.TestCase):

View File

@ -4,15 +4,14 @@ standard portal_catalog for indexing comments.
BBB support for the old portal_discussion is provided in the bbb package. BBB support for the old portal_discussion is provided in the bbb package.
""" """
from OFS.SimpleItem import SimpleItem
from Products.CMFCore.utils import UniqueObject
from Products.CMFCore.utils import getToolByName
from interfaces import IComment
from interfaces import ICommentingTool
from zope import interface from zope import interface
from zope.component import queryUtility from zope.component import queryUtility
from interfaces import ICommentingTool, IComment
from Products.CMFCore.utils import UniqueObject, getToolByName
from OFS.SimpleItem import SimpleItem
class CommentingTool(UniqueObject, SimpleItem): class CommentingTool(UniqueObject, SimpleItem):

View File

@ -1,6 +1,7 @@
from zope.component import getUtility
from plone.registry.interfaces import IRegistry
from plone.app.discussion.interfaces import IDiscussionSettings from plone.app.discussion.interfaces import IDiscussionSettings
from plone.registry.interfaces import IRegistry
from zope.component import getUtility
default_profile = 'profile-plone.app.discussion:default' default_profile = 'profile-plone.app.discussion:default'

View File

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
from plone.app.discussion.interfaces import _ from plone.app.discussion.interfaces import _
from zope.schema.vocabulary import SimpleTerm
from zope.schema.vocabulary import SimpleVocabulary
HAS_CAPTCHA = False HAS_CAPTCHA = False
try: try: