Created
September 10, 2014 20:18
-
-
Save lbragstad/b9fb414ab1687f0d62af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FIXME(lbragstad): Move this test to tests/test_v3_assignment.py | |
def test_delete_user_before_role_assignment_succeeds(self): | |
"""Call ``DELETE`` on the user before the role assignment.""" | |
# Assign the user a role on the project | |
collection_url = ( | |
'/projects/%(project_id)s/users/%(user_id)s/roles' % { | |
'project_id': self.project_id, | |
'user_id': self.user_id}) | |
member_url = ('%(collection_url)s/%(role_id)s' % { | |
'collection_url': collection_url, | |
'role_id': self.role_id}) | |
self.put(member_url, expected_status=204) | |
# Delete the user | |
self.delete('/users/%(user_id)s' % {'user_id': self.user['id']}, | |
expected_status=204) | |
# Check if the user has the specified role on the project | |
# FIXME(lbragstad): locally, this is raising a 401 Unauthorized | |
# because of https://github.com/openstack/keystone/blob/master/keystone/auth/plugins/password.py#L100 | |
self.head(member_url, expected_status=404) | |
# Attempt revoking the role from the user | |
self.delete(member_url, expected_status=404) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment