Skip to content

Commit

Permalink
Sync bbb PloneTestCase class with original one
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGES.rst
  • Loading branch information
tomgross committed Jan 13, 2014
1 parent b548e18 commit 426ead1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,12 @@
Changelog
=========

4.2.3 (unreleased)
------------------

- Sync bbb PloneTestCase class with original one.
[tomgross]

4.2.2 (2013-02-09)
------------------

Expand Down
15 changes: 12 additions & 3 deletions plone/app/testing/bbb.py
Expand Up @@ -3,6 +3,7 @@
from plone.testing import z2
from plone.app import testing
from Testing.ZopeTestCase.functional import Functional
from AccessControl import getSecurityManager
import transaction
import unittest

Expand Down Expand Up @@ -83,9 +84,17 @@ def beforeTearDown(self):
def afterTearDown(self):
"""Hook to do teardown after the portal is removed."""

def setRoles(self, roles):
"""Set the effective roles of the test user."""
testing.setRoles(self.portal, testing.TEST_USER_ID, roles)
def setRoles(self, roles, name=testing.TEST_USER_ID):
"""Set the effective roles of a user."""
testing.setRoles(self.portal, name, roles)

def setGroups(self, groups, name=testing.TEST_USER_ID):
'''Changes the user's groups.'''
uf = self.portal['acl_users']
uf.userSetGroups(name, list(groups))
user = getSecurityManager().getUser()
if name == user.getId():
self.login(user.getUserName())

def setPermissions(self, permissions, role='Member'):
"""Changes the permissions assigned to role."""
Expand Down

1 comment on commit 426ead1

@mister-roboto
Copy link

Choose a reason for hiding this comment

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

TESTS FAILED
Mr.roboto url : http://jenkins.plone.org/roboto/get_info?push=533ca6a609dc4aa1b19c287564b397fe
plone-4.2-python-2.6 [FAILURE]
plone-4.2-python-2.7 [FAILURE]
plone-4.3-python-2.6 [FAILURE]
plone-4.3-python-2.7 [FAILURE]

Please sign in to comment.