mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 04:20:12 +03:00
Merge 9ce41698f3
into 1f693c331e
This commit is contained in:
commit
3bd95a1cbc
|
@ -317,6 +317,11 @@ You can use any of REST framework's test case classes as you would for the regul
|
||||||
"""
|
"""
|
||||||
url = reverse('account-list')
|
url = reverse('account-list')
|
||||||
data = {'name': 'DabApps'}
|
data = {'name': 'DabApps'}
|
||||||
|
|
||||||
|
# Make an authenticated request
|
||||||
|
user = User.objects.get(username='arlene')
|
||||||
|
self.client.force_authenticate(user=user)
|
||||||
|
|
||||||
response = self.client.post(url, data, format='json')
|
response = self.client.post(url, data, format='json')
|
||||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||||
self.assertEqual(Account.objects.count(), 1)
|
self.assertEqual(Account.objects.count(), 1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user