Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the dummy security manager on test tear down #36

Merged
merged 2 commits into from Oct 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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