Fix role creation API not returning id of new role. GitLab issue #390.

Thanks to @lokeshmanmode for the find.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-06-17 03:00:58 -04:00
parent 215b76bfab
commit 40ab6b6f9f
3 changed files with 6 additions and 2 deletions

View File

@@ -59,9 +59,12 @@ class PermissionAPITestCase(BaseAPITestCase):
def test_role_create_view(self):
response = self._role_create_request()
role = Role.objects.first()
self.assertEqual(response.status_code, 201)
self.assertEqual(response.data, {'label': role.label, 'id': role.pk})
self.assertEqual(Role.objects.count(), 1)
self.assertEqual(Role.objects.first().label, TEST_ROLE_LABEL)
self.assertEqual(role.label, TEST_ROLE_LABEL)
def _create_group(self):
self.group = Group.objects.create(name=TEST_GROUP_NAME)