diff --git a/CHANGES.rst b/CHANGES.rst index 0f9dfb5..cd847e7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,6 +14,9 @@ New features: Bug fixes: +- Fix tests to work with merges plone.login. + [jensens] + - More Python 2 / 3 compatibility. [pbauer] diff --git a/docs/source/conf.py b/docs/source/conf.py index 71374d4..925d131 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,8 +11,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os +import sys + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/plone/app/discussion/browser/comment.py b/plone/app/discussion/browser/comment.py index 6497fec..12fa62a 100644 --- a/plone/app/discussion/browser/comment.py +++ b/plone/app/discussion/browser/comment.py @@ -1,8 +1,8 @@ # coding: utf-8 +from .comments import CommentForm from AccessControl import getSecurityManager from Acquisition import aq_inner from Acquisition import aq_parent -from .comments import CommentForm from plone.app.discussion import _ from plone.registry.interfaces import IRegistry from plone.z3cform.layout import wrap_form diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 2689c97..7f08f17 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -32,7 +32,6 @@ from zope.i18n import translate from zope.i18nmessageid import Message from zope.interface import alsoProvides - import six diff --git a/plone/app/discussion/comment.py b/plone/app/discussion/comment.py index 33d77f4..de9e48f 100644 --- a/plone/app/discussion/comment.py +++ b/plone/app/discussion/comment.py @@ -38,8 +38,6 @@ from zope.i18nmessageid import Message from zope.interface import implementer import logging - - import six diff --git a/plone/app/discussion/conversation.py b/plone/app/discussion/conversation.py index e7dec30..0863504 100644 --- a/plone/app/discussion/conversation.py +++ b/plone/app/discussion/conversation.py @@ -37,10 +37,8 @@ from zope.lifecycleevent import ObjectAddedEvent from zope.lifecycleevent import ObjectCreatedEvent from zope.lifecycleevent import ObjectRemovedEvent -import time - - import six +import time @implementer(IConversation, IHideFromBreadcrumbs) diff --git a/plone/app/discussion/tests/functional_test_comment_review_workflow.txt b/plone/app/discussion/tests/functional_test_comment_review_workflow.txt index cd654d9..a835f96 100644 --- a/plone/app/discussion/tests/functional_test_comment_review_workflow.txt +++ b/plone/app/discussion/tests/functional_test_comment_review_workflow.txt @@ -143,7 +143,7 @@ actions. >>> browser.open(portal_url + '/login_form') >>> browser.getControl(name='__ac_name').value = 'jack' >>> browser.getControl(name='__ac_password').value = 'secret' - >>> browser.getControl(name='submit').click() + >>> browser.getControl('Log in').click() >>> browser.open(urldoc) @@ -241,7 +241,7 @@ Enable anonymous comment with email. >>> browser.open(portal_url + '/login_form') >>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_password').value = 'secret' - >>> browser.getControl(name='submit').click() + >>> browser.getControl('Log in').click() >>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected' @@ -274,7 +274,7 @@ The new comment is shown in moderation view with authors name and email. >>> browser.url 'http://nohost/plone/@@moderate-comments' - + >>> 'John' in browser.contents True diff --git a/plone/app/discussion/tests/functional_test_comments.txt b/plone/app/discussion/tests/functional_test_comments.txt index c9fe2bd..97e195b 100644 --- a/plone/app/discussion/tests/functional_test_comments.txt +++ b/plone/app/discussion/tests/functional_test_comments.txt @@ -126,7 +126,7 @@ Login as user (without the 'Member' role). >>> browser_user.open(portal_url + '/login_form') >>> browser_user.getControl(name='__ac_name').value = 'johndoe' >>> browser_user.getControl(name='__ac_password').value = 'secret' - >>> browser_user.getControl(name='submit').click() + >>> browser_user.getControl('Log in').click() Users without the 'Reply to item' permission will not see the comment form, because they don't have the 'Reply to item' permission. By default, this @@ -146,7 +146,7 @@ Login as user 'jim'. >>> browser_member.open(portal_url + '/login_form') >>> browser_member.getControl(name='__ac_name').value = 'jim' >>> browser_member.getControl(name='__ac_password').value = 'secret' - >>> browser_member.getControl(name='submit').click() + >>> browser_member.getControl('Log in').click() Post a comment as user jim. @@ -180,7 +180,7 @@ Enable anonymous comment >>> browser.open(portal_url + '/login_form') >>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_password').value = 'secret' - >>> browser.getControl(name='submit').click() + >>> browser.getControl('Log in').click() >>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected' >>> browser.getControl(name='form.buttons.save').click() @@ -391,7 +391,7 @@ Now login as user 'reviewer' >>> browser_reviewer.open(portal_url + '/login_form') >>> browser_reviewer.getControl(name='__ac_name').value = 'reviewer' >>> browser_reviewer.getControl(name='__ac_password').value = 'secret' - >>> browser_reviewer.getControl(name='submit').click() + >>> browser_reviewer.getControl('Log in').click() Admin and who have 'Delete comments' permission (reviewers for example), can delete comments @@ -461,7 +461,7 @@ Login as admin. >>> browser.open(portal_url + '/login_form') >>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_password').value = 'secret' - >>> browser.getControl(name='submit').click() + >>> browser.getControl('Log in').click() Edit the content object. @@ -490,7 +490,7 @@ Edit the control panel. >>> browser.open(portal_url + '/login_form') >>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_password').value = 'secret' - >>> browser.getControl(name='submit').click() + >>> browser.getControl('Log in').click() >>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected' >>> browser.getControl(name='form.buttons.save').click() @@ -542,7 +542,7 @@ Login as user 'jim'. >>> browser_member.open(portal_url + '/login_form') >>> browser_member.getControl(name='__ac_name').value = 'jim' >>> browser_member.getControl(name='__ac_password').value = 'secret' - >>> browser_member.getControl(name='submit').click() + >>> browser_member.getControl('Log in').click() Post a comment as user jim. diff --git a/plone/app/discussion/tests/test_conversation.py b/plone/app/discussion/tests/test_conversation.py index 4b4e30b..e88d13e 100644 --- a/plone/app/discussion/tests/test_conversation.py +++ b/plone/app/discussion/tests/test_conversation.py @@ -19,10 +19,8 @@ from zope.annotation.interfaces import IAnnotations from zope.component import createObject from zope.component import queryUtility -import unittest - - import six +import unittest try: diff --git a/plone/app/discussion/tests/test_indexers.py b/plone/app/discussion/tests/test_indexers.py index 118a1fe..0c784d1 100644 --- a/plone/app/discussion/tests/test_indexers.py +++ b/plone/app/discussion/tests/test_indexers.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- """Test for the plone.app.discussion indexers """ -from datetime import datetime 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