isort
This commit is contained in:
parent
224e99425e
commit
e72d86b985
@ -14,7 +14,6 @@ from zope.component import getMultiAdapter
|
|||||||
from zope.component import getUtility
|
from zope.component import getUtility
|
||||||
from zope.event import notify
|
from zope.event import notify
|
||||||
from zope.lifecycleevent import ObjectModifiedEvent
|
from zope.lifecycleevent import ObjectModifiedEvent
|
||||||
from .comments import CommentForm
|
|
||||||
|
|
||||||
|
|
||||||
class View(BrowserView):
|
class View(BrowserView):
|
||||||
|
@ -16,10 +16,13 @@ from zope.component import getUtility
|
|||||||
from zope.component import queryUtility
|
from zope.component import queryUtility
|
||||||
from zope.component.hooks import getSite
|
from zope.component.hooks import getSite
|
||||||
|
|
||||||
|
|
||||||
# try/except was added because Configuration Changed Event was moved inside the
|
# try/except was added because Configuration Changed Event was moved inside the
|
||||||
# controlpanel file in the PR #2495 on Products.CMFPlone
|
# controlpanel file in the PR #2495 on Products.CMFPlone
|
||||||
try:
|
try:
|
||||||
from Products.CMFPlone.interfaces.controlpanel import IConfigurationChangedEvent # noqa: E501
|
from Products.CMFPlone.interfaces.controlpanel import ( # noqa: E501
|
||||||
|
IConfigurationChangedEvent,
|
||||||
|
)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from Products.CMFPlone.interfaces import IConfigurationChangedEvent
|
from Products.CMFPlone.interfaces import IConfigurationChangedEvent
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ from AccessControl import getSecurityManager
|
|||||||
from AccessControl import Unauthorized
|
from AccessControl import Unauthorized
|
||||||
from Acquisition import aq_inner
|
from Acquisition import aq_inner
|
||||||
from Acquisition import aq_parent
|
from Acquisition import aq_parent
|
||||||
|
from plone.app.discussion.events import CommentDeletedEvent
|
||||||
from plone.app.discussion.events import CommentPublishedEvent
|
from plone.app.discussion.events import CommentPublishedEvent
|
||||||
from plone.app.discussion.events import CommentTransitionEvent
|
from plone.app.discussion.events import CommentTransitionEvent
|
||||||
from plone.app.discussion.events import CommentDeletedEvent
|
|
||||||
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
|
||||||
|
@ -15,6 +15,7 @@ from Products.ZCatalog.interfaces import IZCatalog
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
|
||||||
MAX_DESCRIPTION = 25
|
MAX_DESCRIPTION = 25
|
||||||
|
|
||||||
# Conversation Indexers
|
# Conversation Indexers
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
""" Custom discussion events
|
""" Custom discussion events
|
||||||
"""
|
"""
|
||||||
from plone.app.discussion.interfaces import ICommentAddedEvent
|
from plone.app.discussion.interfaces import ICommentAddedEvent
|
||||||
from plone.app.discussion.interfaces import ICommentModifiedEvent
|
|
||||||
from plone.app.discussion.interfaces import ICommentRemovedEvent
|
|
||||||
from plone.app.discussion.interfaces import IDiscussionEvent
|
|
||||||
from plone.app.discussion.interfaces import ICommentDeletedEvent
|
from plone.app.discussion.interfaces import ICommentDeletedEvent
|
||||||
|
from plone.app.discussion.interfaces import ICommentModifiedEvent
|
||||||
from plone.app.discussion.interfaces import ICommentPublishedEvent
|
from plone.app.discussion.interfaces import ICommentPublishedEvent
|
||||||
|
from plone.app.discussion.interfaces import ICommentRemovedEvent
|
||||||
from plone.app.discussion.interfaces import ICommentTransitionEvent
|
from plone.app.discussion.interfaces import ICommentTransitionEvent
|
||||||
|
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 IReplyModifiedEvent
|
from plone.app.discussion.interfaces import IReplyModifiedEvent
|
||||||
from plone.app.discussion.interfaces import IReplyRemovedEvent
|
from plone.app.discussion.interfaces import IReplyRemovedEvent
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
"""
|
"""
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from plone.app.discussion.interfaces import IConversation
|
from plone.app.discussion.interfaces import IConversation
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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 Products.CMFCore.utils import getToolByName
|
from Products.CMFCore.utils import getToolByName
|
||||||
|
@ -3,7 +3,9 @@ from plone.app.discussion.browser.comment import View
|
|||||||
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 IReplies
|
from plone.app.discussion.interfaces import IReplies
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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 Products.CMFCore.utils import getToolByName
|
from Products.CMFCore.utils import getToolByName
|
||||||
|
@ -8,7 +8,9 @@ from plone.app.discussion.browser.comments import CommentForm
|
|||||||
from plone.app.discussion.browser.comments import CommentsViewlet
|
from plone.app.discussion.browser.comments import CommentsViewlet
|
||||||
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.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
from plone.app.testing import login
|
from plone.app.testing import login
|
||||||
from plone.app.testing import logout
|
from plone.app.testing import logout
|
||||||
from plone.app.testing import setRoles
|
from plone.app.testing import setRoles
|
||||||
|
@ -5,7 +5,9 @@ from plone.app.discussion.interfaces import IConversation
|
|||||||
from plone.app.discussion.interfaces import IReplies
|
from plone.app.discussion.interfaces import 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.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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.contentrules.rule.interfaces import IRuleEventType
|
from plone.contentrules.rule.interfaces import IRuleEventType
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from plone.app.discussion.interfaces import IDiscussionSettings
|
from plone.app.discussion.interfaces import IDiscussionSettings
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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 import Registry
|
from plone.registry import Registry
|
||||||
|
@ -8,7 +8,9 @@ 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.app.discussion.interfaces import IReplies
|
from plone.app.discussion.interfaces import IReplies
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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.app.vocabularies.types import BAD_TYPES
|
from plone.app.vocabularies.types import BAD_TYPES
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from plone.app.discussion.interfaces import IConversation
|
from plone.app.discussion.interfaces import IConversation
|
||||||
from plone.app.discussion.interfaces import IReplies
|
from plone.app.discussion.interfaces import IReplies
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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 Zope2.App import zcml
|
from Zope2.App import zcml
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""Test for the plone.app.discussion indexers
|
"""Test for the plone.app.discussion indexers
|
||||||
"""
|
"""
|
||||||
from DateTime import DateTime
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from DateTime import DateTime
|
||||||
from plone.app.discussion import catalog
|
from plone.app.discussion import catalog
|
||||||
from plone.app.discussion.interfaces import IConversation
|
from plone.app.discussion.interfaces import IConversation
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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.indexer.delegate import DelegatingIndexerFactory
|
from plone.indexer.delegate import DelegatingIndexerFactory
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from plone.app.discussion.browser.moderation import BulkActionsView
|
from plone.app.discussion.browser.moderation import BulkActionsView
|
||||||
from plone.app.discussion.browser.moderation import DeleteComment
|
|
||||||
from plone.app.discussion.browser.moderation import CommentTransition
|
from plone.app.discussion.browser.moderation import CommentTransition
|
||||||
|
from plone.app.discussion.browser.moderation import DeleteComment
|
||||||
from plone.app.discussion.browser.moderation import View
|
from plone.app.discussion.browser.moderation import View
|
||||||
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.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from plone.app.discussion.browser.moderation import BulkActionsView
|
from plone.app.discussion.browser.moderation import BulkActionsView
|
||||||
from plone.app.discussion.browser.moderation import DeleteComment
|
|
||||||
from plone.app.discussion.browser.moderation import CommentTransition
|
from plone.app.discussion.browser.moderation import CommentTransition
|
||||||
|
from plone.app.discussion.browser.moderation import DeleteComment
|
||||||
from plone.app.discussion.browser.moderation import View
|
from plone.app.discussion.browser.moderation import View
|
||||||
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.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from Acquisition import aq_base
|
from Acquisition import aq_base
|
||||||
from plone.app.discussion.interfaces import IConversation
|
from plone.app.discussion.interfaces import IConversation
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
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
|
||||||
|
@ -4,7 +4,9 @@
|
|||||||
from AccessControl import Unauthorized
|
from AccessControl import Unauthorized
|
||||||
from plone.app.discussion.interfaces import IConversation
|
from plone.app.discussion.interfaces import IConversation
|
||||||
from plone.app.discussion.interfaces import IDiscussionLayer
|
from plone.app.discussion.interfaces import IDiscussionLayer
|
||||||
from plone.app.discussion.testing import PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa
|
from plone.app.discussion.testing import ( # noqa
|
||||||
|
PLONE_APP_DISCUSSION_INTEGRATION_TESTING,
|
||||||
|
)
|
||||||
from plone.app.testing import login
|
from plone.app.testing import login
|
||||||
from plone.app.testing import logout
|
from plone.app.testing import logout
|
||||||
from plone.app.testing import setRoles
|
from plone.app.testing import setRoles
|
||||||
@ -175,6 +177,7 @@ class CommentOneStateWorkflowTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_migration(self):
|
def test_migration(self):
|
||||||
from plone.app.discussion.upgrades import upgrade_comment_workflows
|
from plone.app.discussion.upgrades import upgrade_comment_workflows
|
||||||
|
|
||||||
# Fake permission according to earlier one_comment_workflow.
|
# Fake permission according to earlier one_comment_workflow.
|
||||||
self.comment._View_Permission = ('Anonymous',)
|
self.comment._View_Permission = ('Anonymous',)
|
||||||
# Anonymous can see the comment.
|
# Anonymous can see the comment.
|
||||||
@ -319,6 +322,7 @@ class CommentReviewWorkflowTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_migration(self):
|
def test_migration(self):
|
||||||
from plone.app.discussion.upgrades import upgrade_comment_workflows
|
from plone.app.discussion.upgrades import upgrade_comment_workflows
|
||||||
|
|
||||||
# Fake permission according to earlier comment_review_workflow.
|
# Fake permission according to earlier comment_review_workflow.
|
||||||
self.comment._View_Permission = ('Anonymous',)
|
self.comment._View_Permission = ('Anonymous',)
|
||||||
# Anonymous can see the comment.
|
# Anonymous can see the comment.
|
||||||
|
Loading…
Reference in New Issue
Block a user