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 -*-
from zope.i18nmessageid import MessageFactory
PloneAppDiscussionMessageFactory = MessageFactory('plone.app.discussion')

View File

@ -1,30 +1,20 @@
# -*- coding: utf-8 -*-
# Captcha validator, see captcha.txt for design notes.
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.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):

View File

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

View File

@ -1,47 +1,37 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_inner
from AccessControl import Unauthorized
from AccessControl import getSecurityManager
from datetime import datetime
from AccessControl import Unauthorized
from Acquisition import aq_inner
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.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.statusmessages.interfaces import IStatusMessage
from plone.registry.interfaces import IRegistry
from plone.app.layout.viewlets.common import ViewletBase
from datetime import datetime
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.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.fieldsets import extensible
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 = _(
u"comment_description_plain_text",

View File

@ -1,28 +1,22 @@
# -*- coding: utf-8 -*-
from zope.component import getUtility
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.interfaces._content import IDiscussionResponse
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces.controlpanel import IMailSchema
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.statusmessages.interfaces import IStatusMessage
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.registry.interfaces import IRegistry
from plone.registry.interfaces import IRecordModifiedEvent
from zope.component.hooks import getSite
from zope.component import getMultiAdapter, queryUtility
from plone.registry.interfaces import IRegistry
from z3c.form import button
from z3c.form.browser.checkbox import SingleCheckBoxFieldWidget
from plone.app.discussion.interfaces import IDiscussionSettings, _
from plone.app.discussion.upgrades import update_registry
from zope.component import getMultiAdapter
from zope.component import getUtility
from zope.component import queryUtility
from zope.component.hooks import getSite
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_chain
from Acquisition import aq_inner
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.interfaces import IFolderish
from Products.CMFPlone.interfaces import IPloneSiteRoot
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces import INonStructuralFolder
from Products.CMFPlone.interfaces import IPloneSiteRoot
from plone.app.discussion.interfaces import IDiscussionSettings
from plone.registry.interfaces import IRegistry
from zope.component import queryUtility
try:
from plone.dexterity.interfaces import IDexterityContent

View File

@ -1,22 +1,16 @@
from datetime import datetime
from Acquisition import aq_inner, aq_parent
from Products.Five.browser import BrowserView
from Products.CMFCore.utils import getToolByName
from Acquisition import aq_inner
from Acquisition import aq_parent
from DateTime import DateTime
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
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):
"""Convert a Zope DateTime (with timezone) into a Python datetime (GMT)."""

View File

@ -1,19 +1,12 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_inner, aq_parent
from AccessControl import Unauthorized
from AccessControl import getSecurityManager
from zope.component import queryUtility
from AccessControl import Unauthorized, getSecurityManager
from Acquisition import aq_inner
from Acquisition import aq_parent
from Products.CMFCore.utils import getToolByName
from Products.Five.browser import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from Products.CMFCore.utils import getToolByName
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 IComment
from plone.app.discussion.interfaces import IReplies

View File

@ -2,14 +2,14 @@
IDiscussion container for the context, from which traversal will continue
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 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):

View File

@ -1,25 +1,20 @@
# -*- coding: utf-8 -*-
"""Captcha validator, see captcha.txt for design notes.
"""
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 IDiscussionSettings
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:
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.
"""
from string import join
from DateTime import DateTime
from Products.CMFCore.interfaces import IContentish
from Products.CMFPlone.utils import safe_unicode
from Products.ZCatalog.interfaces import IZCatalog
from plone.app.discussion.interfaces import IConversation, IComment
from plone.indexer import indexer
from plone.uuid.interfaces import IUUID
from string import join
MAX_DESCRIPTION = 25

View File

@ -1,57 +1,43 @@
# -*- coding: utf-8 -*-
"""The default comment class and factory.
"""
import logging
from datetime import datetime
from smtplib import SMTPException
from zope.annotation.interfaces import IAnnotatable
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 AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager
from Acquisition import Implicit
from Acquisition import aq_base
from Acquisition import aq_parent
from Products.CMFCore import permissions
from Products.CMFCore.CMFCatalogAware import CatalogAware
from Products.CMFCore.CMFCatalogAware import WorkflowAware
from Products.CMFCore.DynamicType import DynamicType
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces.controlpanel import IMailSchema
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 persistent import Persistent
from plone.app.discussion import PloneAppDiscussionMessageFactory as _
from plone.app.discussion.events import CommentAddedEvent
from plone.app.discussion.events import CommentRemovedEvent
from plone.app.discussion.events import ReplyAddedEvent
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 IConversation
from plone.app.discussion.interfaces import IDiscussionSettings
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
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
import logging
COMMENT_TITLE = _(

View File

@ -1,12 +1,12 @@
""" 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 ICommentRemovedEvent
from plone.app.discussion.interfaces import IDiscussionEvent
from plone.app.discussion.interfaces import IReplyAddedEvent
from plone.app.discussion.interfaces import IReplyRemovedEvent
from zope.interface import implements
class DiscussionEvent(object):
""" Custom event

View File

@ -1,13 +1,11 @@
# -*- coding: utf-8 -*-
"""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.common.mapping import IIterableMapping
from zope.component.interfaces import IObjectEvent
from zope import schema
from plone.app.discussion import PloneAppDiscussionMessageFactory as _
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 Acquisition import aq_inner, aq_parent
from zope.annotation.interfaces import IAnnotations
from Products.CMFPlone.utils import base_hasattr
from Products.CMFPlone.utils import safe_callable
from plone.app.discussion.conversation import ANNOTATION_KEY
from zope.annotation.interfaces import IAnnotations
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.discussion.interfaces import IDiscussionSettings
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 TEST_USER_ID
from plone.registry.interfaces import IRegistry
from Products.CMFCore.utils import getToolByName
from zope.component import queryUtility
from zope.configuration import xmlconfig

View File

@ -1,23 +1,16 @@
"""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
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
import unittest2 as unittest
class CatalogSetupTest(unittest.TestCase):

View File

@ -1,24 +1,18 @@
# -*- coding: utf-8 -*-
import datetime
import logging
import unittest2 as unittest
from Products.CMFCore.utils import getToolByName
from plone.app.discussion.browser.comment import View
from plone.app.discussion.interfaces import IComment
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
from zope.component import getMultiAdapter
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 IComment, IConversation, IReplies
from plone.app.discussion.browser.comment import View
import datetime
import logging
import unittest2 as unittest
logger = logging.getLogger('plone.app.discussion.tests')

View File

@ -1,46 +1,36 @@
# -*- coding: utf-8 -*-
import unittest2 as unittest
import time
from datetime import datetime
from AccessControl import Unauthorized
from datetime import datetime
from OFS.Image import Image
from zope import interface
from zope.interface import alsoProvides
from zope.publisher.browser import TestRequest
from zope.annotation.interfaces import IAttributeAnnotatable
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.tests import dummy
from plone.app.discussion import interfaces
from plone.app.discussion.browser.comment import EditCommentForm
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 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 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.interface import Interface
from zope.component import getMultiAdapter
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
import time
import unittest2 as unittest
class TestCommentForm(unittest.TestCase):

View File

@ -1,21 +1,19 @@
# -*- 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 ICommentRemovedEvent
from plone.app.discussion.interfaces import IConversation, IReplies
from plone.app.discussion.interfaces import IReplyAddedEvent
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):
""" Test custom comments events

View File

@ -1,19 +1,15 @@
# -*- 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 queryUtility
from plone.registry import Registry
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
import unittest2 as unittest
class RegistryTest(unittest.TestCase):

View File

@ -1,29 +1,25 @@
import unittest2 as unittest
from datetime import datetime, timedelta
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 Acquisition import aq_base
from Acquisition import aq_parent
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 datetime import datetime
from datetime import timedelta
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 IReplies
from plone.app.discussion.interfaces import IConversation
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:
from plone.dexterity.interfaces import IDexterityContent

View File

@ -1,17 +1,21 @@
# -*- coding: utf-8 -*-
import unittest2 as unittest
from zope.component import createObject
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
from plone.app.testing import TEST_USER_ID, setRoles
from plone.app.discussion.interfaces import IConversation, IReplies
from plone.app.discussion.testing import (
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
)
import unittest2 as unittest
#
# Fake events registry
#
class EventsRegistry(object):
""" 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.
"""
import doctest
import unittest2 as unittest
import pprint
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING # noqa
from plone.testing import layered
from plone.app.discussion.testing import \
PLONE_APP_DISCUSSION_FUNCTIONAL_TESTING
import doctest
import pprint
import unittest2 as unittest
optionflags = (

View File

@ -1,23 +1,17 @@
"""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
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
diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,

View File

@ -1,18 +1,14 @@
# -*- 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 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.browser.moderation import View
from plone.app.discussion.browser.moderation import BulkActionsView
from plone.app.discussion.interfaces import IConversation
import unittest
class ModerationViewTest(unittest.TestCase):

View File

@ -1,25 +1,19 @@
# -*- coding: utf-8 -*-
import unittest2 as unittest
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 getSiteManager
from zope.component import queryUtility
from zope.component import getUtility
from zope.component import queryUtility
from plone.app.testing import TEST_USER_ID, setRoles
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
import unittest2 as unittest
class TestUserNotificationUnit(unittest.TestCase):

View File

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

View File

@ -1,23 +1,20 @@
# -*- coding: utf-8 -*-
"""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.interface import alsoProvides
from AccessControl import Unauthorized
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
import unittest2 as unittest
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.
"""
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.component import queryUtility
from interfaces import ICommentingTool, IComment
from Products.CMFCore.utils import UniqueObject, getToolByName
from OFS.SimpleItem import 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.registry.interfaces import IRegistry
from zope.component import getUtility
default_profile = 'profile-plone.app.discussion:default'

View File

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