Skip to content

Commit

Permalink
Merge pull request #36 from plone/python3
Browse files Browse the repository at this point in the history
Remove the dummy security manager on test tear down
  • Loading branch information
ale-rt committed Oct 3, 2018
2 parents d8699cb + d8e74cd commit 6b39d44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Expand Up @@ -14,7 +14,8 @@ New features:

Bug fixes:

- *add item here*
- Remove the dummy security manager on test tear down
[ale-rt]


1.8.0 (2018-09-26)
Expand Down
6 changes: 5 additions & 1 deletion plone/autoform/tests/test_utils.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import getSecurityManager
from plone.autoform.interfaces import WRITE_PERMISSIONS_KEY
from plone.autoform.utils import processFields
from plone.supermodel.interfaces import FIELDSETS_KEY
Expand Down Expand Up @@ -38,9 +38,13 @@ def checkPermission(self, perm, context):
self.checks.append(perm)
return False

self.oldsecman = getSecurityManager()
self.secman = DummySecurityManager()
setSecurityManager(self.secman)

def tearDown(self):
setSecurityManager(self.oldsecman)

def test_processFields_permissionChecks_no_prefix(self):
form = Form(None, None)
form.groups = ()
Expand Down

2 comments on commit 6b39d44

@jenkins-plone-org
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ale-rt Jenkins CI reporting about code analysis
See the full report here: https://jenkins.plone.org/job/package-plone.autoform/42/violations

plone/autoform/base.py:35:5: C901 'AutoFields.updateFieldsFromSchemata' is too complex (11)
plone/autoform/base.py:57:52: C812 missing trailing comma
plone/autoform/base.py:117:43: C812 missing trailing comma
plone/autoform/base.py:166:5: C901 'AutoFields._calculate_field_moves' is too complex (11)
plone/autoform/base.py:241:72: C812 missing trailing comma
plone/autoform/base.py:259:42: C812 missing trailing comma
plone/autoform/base.py:260:30: C812 missing trailing comma
plone/autoform/directives.py:30:71: C812 missing trailing comma
plone/autoform/directives.py:64:75: C812 missing trailing comma
plone/autoform/directives.py:127:40: C812 missing trailing comma
plone/autoform/directives.py:135:74: C812 missing trailing comma
plone/autoform/form.py:24:34: C812 missing trailing comma
plone/autoform/interfaces.py:46:22: C812 missing trailing comma
plone/autoform/interfaces.py:51:26: C812 missing trailing comma
plone/autoform/interfaces.py:58:30: C812 missing trailing comma
plone/autoform/interfaces.py:60:23: C812 missing trailing comma
plone/autoform/interfaces.py:71:26: C812 missing trailing comma
plone/autoform/interfaces.py:85:46: C812 missing trailing comma
plone/autoform/interfaces.py:89:27: C812 missing trailing comma
plone/autoform/interfaces.py:90:10: C812 missing trailing comma
plone/autoform/interfaces.py:96:35: C812 missing trailing comma
plone/autoform/interfaces.py:100:29: C812 missing trailing comma
plone/autoform/interfaces.py:101:10: C812 missing trailing comma
plone/autoform/supermodel.py:53:78: C812 missing trailing comma
plone/autoform/supermodel.py:71:5: C901 'FormSchema.read' is too complex (11)
plone/autoform/supermodel.py:107:70: C812 missing trailing comma
plone/autoform/supermodel.py:113:5: C901 'FormSchema.write' is too complex (14)
plone/autoform/supermodel.py:160:41: C812 missing trailing comma
plone/autoform/supermodel.py:183:51: C812 missing trailing comma
plone/autoform/supermodel.py:201:37: C812 missing trailing comma
plone/autoform/supermodel.py:205:15: C812 missing trailing comma
plone/autoform/supermodel.py:211:32: C812 missing trailing comma
plone/autoform/supermodel.py:216:33: C812 missing trailing comma
plone/autoform/utils.py:123:1: C901 '_process_fieldsets' is too complex (11)
plone/autoform/utils.py:129:18: C812 missing trailing comma
plone/autoform/utils.py:163:69: C815 missing trailing comma in Python 3.5+
plone/autoform/utils.py:209:29: C812 missing trailing comma
plone/autoform/utils.py:214:30: C812 missing trailing comma
plone/autoform/utils.py:237:37: C812 missing trailing comma
plone/autoform/utils.py:238:22: C812 missing trailing comma
plone/autoform/utils.py:282:36: C812 missing trailing comma
plone/autoform/utils.py:296:38: C812 missing trailing comma
plone/autoform/widgets.py:64:28: C812 missing trailing comma
plone/autoform/widgets.py:89:24: C812 missing trailing comma
plone/autoform/widgets.py:117:43: C812 missing trailing comma
plone/autoform/widgets.py:141:29: C812 missing trailing comma
plone/autoform/widgets.py:154:53: C812 missing trailing comma
plone/autoform/widgets.py:158:52: C812 missing trailing comma
plone/autoform/tests/test_base.py:48:73: C812 missing trailing comma
plone/autoform/tests/test_base.py:50:59: C812 missing trailing comma
plone/autoform/tests/test_base.py:52:18: C812 missing trailing comma
plone/autoform/tests/test_base.py:53:14: C812 missing trailing comma
plone/autoform/tests/test_directives.py:77:49: C812 missing trailing comma
plone/autoform/tests/test_directives.py:171:58: C812 missing trailing comma
plone/autoform/tests/test_directives.py:175:59: C812 missing trailing comma
plone/autoform/tests/test_directives.py:209:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:42:60: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:49:60: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:60:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:64:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:68:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:72:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:76:23: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:85:60: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:105:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:109:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:114:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:118:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:139:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:143:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:150:52: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:155:50: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:169:46: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:173:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:178:44: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:182:49: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:193:71: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:257:57: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:270:79: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:308:46: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:314:44: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:324:56: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:328:59: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:334:56: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:339:59: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:358:37: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:375:24: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:435:56: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:439:57: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:468:66: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:472:67: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:488:66: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:492:67: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:506:66: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:510:67: C812 missing trailing comma
plone/autoform/tests/test_utils.py:3:1: I001 isort found an import in the wrong position

Follow these instructions to reproduce it locally.

@jenkins-plone-org
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ale-rt Jenkins CI reporting about code analysis
See the full report here: https://jenkins.plone.org/job/package-plone.autoform/43/violations

plone/autoform/base.py:35:5: C901 'AutoFields.updateFieldsFromSchemata' is too complex (11)
plone/autoform/base.py:57:52: C812 missing trailing comma
plone/autoform/base.py:117:43: C812 missing trailing comma
plone/autoform/base.py:166:5: C901 'AutoFields._calculate_field_moves' is too complex (11)
plone/autoform/base.py:241:72: C812 missing trailing comma
plone/autoform/base.py:259:42: C812 missing trailing comma
plone/autoform/base.py:260:30: C812 missing trailing comma
plone/autoform/directives.py:30:71: C812 missing trailing comma
plone/autoform/directives.py:64:75: C812 missing trailing comma
plone/autoform/directives.py:127:40: C812 missing trailing comma
plone/autoform/directives.py:135:74: C812 missing trailing comma
plone/autoform/form.py:24:34: C812 missing trailing comma
plone/autoform/interfaces.py:46:22: C812 missing trailing comma
plone/autoform/interfaces.py:51:26: C812 missing trailing comma
plone/autoform/interfaces.py:58:30: C812 missing trailing comma
plone/autoform/interfaces.py:60:23: C812 missing trailing comma
plone/autoform/interfaces.py:71:26: C812 missing trailing comma
plone/autoform/interfaces.py:85:46: C812 missing trailing comma
plone/autoform/interfaces.py:89:27: C812 missing trailing comma
plone/autoform/interfaces.py:90:10: C812 missing trailing comma
plone/autoform/interfaces.py:96:35: C812 missing trailing comma
plone/autoform/interfaces.py:100:29: C812 missing trailing comma
plone/autoform/interfaces.py:101:10: C812 missing trailing comma
plone/autoform/supermodel.py:53:78: C812 missing trailing comma
plone/autoform/supermodel.py:71:5: C901 'FormSchema.read' is too complex (11)
plone/autoform/supermodel.py:107:70: C812 missing trailing comma
plone/autoform/supermodel.py:113:5: C901 'FormSchema.write' is too complex (14)
plone/autoform/supermodel.py:160:41: C812 missing trailing comma
plone/autoform/supermodel.py:183:51: C812 missing trailing comma
plone/autoform/supermodel.py:201:37: C812 missing trailing comma
plone/autoform/supermodel.py:205:15: C812 missing trailing comma
plone/autoform/supermodel.py:211:32: C812 missing trailing comma
plone/autoform/supermodel.py:216:33: C812 missing trailing comma
plone/autoform/utils.py:123:1: C901 '_process_fieldsets' is too complex (11)
plone/autoform/utils.py:129:18: C812 missing trailing comma
plone/autoform/utils.py:163:69: C815 missing trailing comma in Python 3.5+
plone/autoform/utils.py:209:29: C812 missing trailing comma
plone/autoform/utils.py:214:30: C812 missing trailing comma
plone/autoform/utils.py:237:37: C812 missing trailing comma
plone/autoform/utils.py:238:22: C812 missing trailing comma
plone/autoform/utils.py:282:36: C812 missing trailing comma
plone/autoform/utils.py:296:38: C812 missing trailing comma
plone/autoform/widgets.py:64:28: C812 missing trailing comma
plone/autoform/widgets.py:89:24: C812 missing trailing comma
plone/autoform/widgets.py:117:43: C812 missing trailing comma
plone/autoform/widgets.py:141:29: C812 missing trailing comma
plone/autoform/widgets.py:154:53: C812 missing trailing comma
plone/autoform/widgets.py:158:52: C812 missing trailing comma
plone/autoform/tests/test_base.py:48:73: C812 missing trailing comma
plone/autoform/tests/test_base.py:50:59: C812 missing trailing comma
plone/autoform/tests/test_base.py:52:18: C812 missing trailing comma
plone/autoform/tests/test_base.py:53:14: C812 missing trailing comma
plone/autoform/tests/test_directives.py:77:49: C812 missing trailing comma
plone/autoform/tests/test_directives.py:171:58: C812 missing trailing comma
plone/autoform/tests/test_directives.py:175:59: C812 missing trailing comma
plone/autoform/tests/test_directives.py:209:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:42:60: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:49:60: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:60:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:64:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:68:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:72:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:76:23: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:85:60: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:105:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:109:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:114:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:118:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:139:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:143:45: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:150:52: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:155:50: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:169:46: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:173:47: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:178:44: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:182:49: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:193:71: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:257:57: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:270:79: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:308:46: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:314:44: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:324:56: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:328:59: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:334:56: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:339:59: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:358:37: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:375:24: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:435:56: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:439:57: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:468:66: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:472:67: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:488:66: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:492:67: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:506:66: C812 missing trailing comma
plone/autoform/tests/test_supermodel_handler.py:510:67: C812 missing trailing comma
plone/autoform/tests/test_utils.py:3:1: I001 isort found an import in the wrong position

Follow these instructions to reproduce it locally.

Please sign in to comment.