Merge pull request #132 from plone/merge-plone-login

fix tests for plone.login merge
This commit is contained in:
Jens W. Klein 2018-06-18 14:17:42 +02:00 committed by GitHub
commit 0a16de8526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 19 additions and 22 deletions

View File

@ -14,6 +14,9 @@ New features:
Bug fixes: Bug fixes:
- Fix tests to work with merges plone.login.
[jensens]
- More Python 2 / 3 compatibility. - More Python 2 / 3 compatibility.
[pbauer] [pbauer]

View File

@ -11,8 +11,9 @@
# All configuration values have a default; values that are commented out # All configuration values have a default; values that are commented out
# serve to show the default. # serve to show the default.
import sys
import os import os
import sys
# If extensions (or modules to document with autodoc) are in another directory, # 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 # add these directories to sys.path here. If the directory is relative to the

View File

@ -1,8 +1,8 @@
# coding: utf-8 # coding: utf-8
from .comments import CommentForm
from AccessControl import getSecurityManager from AccessControl import getSecurityManager
from Acquisition import aq_inner from Acquisition import aq_inner
from Acquisition import aq_parent from Acquisition import aq_parent
from .comments import CommentForm
from plone.app.discussion import _ from plone.app.discussion import _
from plone.registry.interfaces import IRegistry from plone.registry.interfaces import IRegistry
from plone.z3cform.layout import wrap_form from plone.z3cform.layout import wrap_form

View File

@ -32,7 +32,6 @@ from zope.i18n import translate
from zope.i18nmessageid import Message from zope.i18nmessageid import Message
from zope.interface import alsoProvides from zope.interface import alsoProvides
import six import six

View File

@ -38,8 +38,6 @@ from zope.i18nmessageid import Message
from zope.interface import implementer from zope.interface import implementer
import logging import logging
import six import six

View File

@ -37,10 +37,8 @@ from zope.lifecycleevent import ObjectAddedEvent
from zope.lifecycleevent import ObjectCreatedEvent from zope.lifecycleevent import ObjectCreatedEvent
from zope.lifecycleevent import ObjectRemovedEvent from zope.lifecycleevent import ObjectRemovedEvent
import time
import six import six
import time
@implementer(IConversation, IHideFromBreadcrumbs) @implementer(IConversation, IHideFromBreadcrumbs)

View File

@ -143,7 +143,7 @@ actions.
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'jack' >>> browser.getControl(name='__ac_name').value = 'jack'
>>> browser.getControl(name='__ac_password').value = 'secret' >>> browser.getControl(name='__ac_password').value = 'secret'
>>> browser.getControl(name='submit').click() >>> browser.getControl('Log in').click()
>>> browser.open(urldoc) >>> browser.open(urldoc)
@ -241,7 +241,7 @@ Enable anonymous comment with email.
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = 'secret' >>> browser.getControl(name='__ac_password').value = 'secret'
>>> browser.getControl(name='submit').click() >>> browser.getControl('Log in').click()
>>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.open(portal_url+'/@@discussion-controlpanel')
>>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected'
>>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected'

View File

@ -126,7 +126,7 @@ Login as user (without the 'Member' role).
>>> browser_user.open(portal_url + '/login_form') >>> browser_user.open(portal_url + '/login_form')
>>> browser_user.getControl(name='__ac_name').value = 'johndoe' >>> browser_user.getControl(name='__ac_name').value = 'johndoe'
>>> browser_user.getControl(name='__ac_password').value = 'secret' >>> 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, 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 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.open(portal_url + '/login_form')
>>> browser_member.getControl(name='__ac_name').value = 'jim' >>> browser_member.getControl(name='__ac_name').value = 'jim'
>>> browser_member.getControl(name='__ac_password').value = 'secret' >>> 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. Post a comment as user jim.
@ -180,7 +180,7 @@ Enable anonymous comment
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = 'secret' >>> browser.getControl(name='__ac_password').value = 'secret'
>>> browser.getControl(name='submit').click() >>> browser.getControl('Log in').click()
>>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.open(portal_url+'/@@discussion-controlpanel')
>>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_comments:list').value = 'selected'
>>> browser.getControl(name='form.buttons.save').click() >>> 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.open(portal_url + '/login_form')
>>> browser_reviewer.getControl(name='__ac_name').value = 'reviewer' >>> browser_reviewer.getControl(name='__ac_name').value = 'reviewer'
>>> browser_reviewer.getControl(name='__ac_password').value = 'secret' >>> 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 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.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = 'secret' >>> browser.getControl(name='__ac_password').value = 'secret'
>>> browser.getControl(name='submit').click() >>> browser.getControl('Log in').click()
Edit the content object. Edit the content object.
@ -490,7 +490,7 @@ Edit the control panel.
>>> browser.open(portal_url + '/login_form') >>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'admin' >>> browser.getControl(name='__ac_name').value = 'admin'
>>> browser.getControl(name='__ac_password').value = 'secret' >>> browser.getControl(name='__ac_password').value = 'secret'
>>> browser.getControl(name='submit').click() >>> browser.getControl('Log in').click()
>>> browser.open(portal_url+'/@@discussion-controlpanel') >>> browser.open(portal_url+'/@@discussion-controlpanel')
>>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected' >>> browser.getControl(name='form.widgets.anonymous_email_enabled:list').value = 'selected'
>>> browser.getControl(name='form.buttons.save').click() >>> browser.getControl(name='form.buttons.save').click()
@ -542,7 +542,7 @@ Login as user 'jim'.
>>> browser_member.open(portal_url + '/login_form') >>> browser_member.open(portal_url + '/login_form')
>>> browser_member.getControl(name='__ac_name').value = 'jim' >>> browser_member.getControl(name='__ac_name').value = 'jim'
>>> browser_member.getControl(name='__ac_password').value = 'secret' >>> 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. Post a comment as user jim.

View File

@ -19,10 +19,8 @@ from zope.annotation.interfaces import IAnnotations
from zope.component import createObject from zope.component import createObject
from zope.component import queryUtility from zope.component import queryUtility
import unittest
import six import six
import unittest
try: try:

View File

@ -1,8 +1,8 @@
# -*- 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 PLONE_APP_DISCUSSION_INTEGRATION_TESTING # noqa