Merge pull request #1493 from normanjaeckel/UserCreate
Added 'id' to user creation response.
This commit is contained in:
commit
35d522d452
@ -67,6 +67,7 @@ class UserCreateUpdateSerializer(ModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
fields = (
|
fields = (
|
||||||
|
'id',
|
||||||
'is_present',
|
'is_present',
|
||||||
'username',
|
'username',
|
||||||
'title',
|
'title',
|
||||||
|
@ -18,7 +18,8 @@ class UserCreate(TestCase):
|
|||||||
{'last_name': 'Test name keimeiShieX4Aekoe3do'})
|
{'last_name': 'Test name keimeiShieX4Aekoe3do'})
|
||||||
|
|
||||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
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):
|
def test_creation_with_group(self):
|
||||||
self.client.login(username='admin', password='admin')
|
self.client.login(username='admin', password='admin')
|
||||||
|
Loading…
Reference in New Issue
Block a user