Commit 7d5499bc by Kit Randel

In the API test client example 'data' was not defined. There's also no

need to define 'expected' as we can just test against the dict.
parent 3c86e25b
......@@ -205,10 +205,10 @@ You can use any of REST framework's test case classes as you would for the regul
Ensure we can create a new account object.
"""
url = reverse('account-list')
expected = {'name': 'DabApps'}
data = {'name': 'DabApps'}
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.data, expected)
self.assertEqual(response.data, data)
---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment