Merge "Keystone REST handles default role incorrectly"

This commit is contained in:
Jenkins 2015-07-28 08:28:17 +00:00 committed by Gerrit Code Review
commit 91875edeb0
2 changed files with 2 additions and 10 deletions

View File

@ -93,14 +93,6 @@ class Users(generic.View):
domain=domain.id
)
# assign role to user
api.keystone.add_tenant_user_role(
request,
project=request.DATA.get('project_id'),
user=new_user.id,
role=request.DATA.get('role_id')
)
return rest_utils.CreatedResponse(
'/api/keystone/users/%s' % new_user.id,
new_user.to_dict()

View File

@ -136,7 +136,7 @@ class KeystoneRestTestCase(test.TestCase):
)
@mock.patch.object(keystone.api, 'keystone')
def _test_user_create(self, supplied_body, expected_call, kc):
def _test_user_create(self, supplied_body, add_user_call, kc):
request = self.mock_rest_request(body=supplied_body)
kc.get_default_domain.return_value = mock.Mock(**{'id': 'the_domain'})
kc.user_create.return_value.id = 'user123'
@ -151,7 +151,7 @@ class KeystoneRestTestCase(test.TestCase):
'/api/keystone/users/user123')
self.assertEqual(response.content, '{"id": "user123", '
'"name": "bob"}')
kc.user_create.assert_called_once_with(request, **expected_call)
kc.user_create.assert_called_once_with(request, **add_user_call)
@mock.patch.object(keystone.api, 'keystone')
def test_user_delete_many(self, kc):