def test_dishes_post self response self client post api dishes title n

1
2
3
4
5
6
7
def test_dishes_post(self):
response = self.client.post('/api/dishes/', {'title': 'new idea'})
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
response = self.client.put('/api/dishes/2/',
{'title': 'new put test!', 'ingredients': ['1', '2']}, content_type='application/json')
print(response)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)