Added 'id' to user creation response.
This commit is contained in:
parent
17afca4568
commit
2ef7c7cf29
@ -67,6 +67,7 @@ class UserCreateUpdateSerializer(ModelSerializer):
|
||||
class Meta:
|
||||
model = User
|
||||
fields = (
|
||||
'id',
|
||||
'is_present',
|
||||
'username',
|
||||
'title',
|
||||
|
@ -18,7 +18,8 @@ class UserCreate(TestCase):
|
||||
{'last_name': 'Test name keimeiShieX4Aekoe3do'})
|
||||
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
self.assertTrue(User.objects.filter(username='Test name keimeiShieX4Aekoe3do').exists())
|
||||
new_user = User.objects.get(username='Test name keimeiShieX4Aekoe3do')
|
||||
self.assertEqual(response.data['id'], new_user.id)
|
||||
|
||||
def test_creation_with_group(self):
|
||||
self.client.login(username='admin', password='admin')
|
||||
|
Loading…
Reference in New Issue
Block a user