Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroel committed Jan 4, 2017
1 parent 44dda98 commit 04010d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plone/api/tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ def test_get_roles_nonexistant_user(self):
with self.assertRaises(UserNotFoundError):
api.user.get_roles(username='theurbanspaceman')

def test_get_roles_anonymous(self):
"""Test get_roles for an anonymous user."""
from AccessControl.users import nobody
with api.env.adopt_user(user=nobody):
self.assertEqual(
api.user.get_roles(),
('Anonymous', )
)

def test_get_roles_in_context(self):
"""Test get local and inherited roles for a user on an object"""
api.user.create(
Expand Down

0 comments on commit 04010d4

Please sign in to comment.