[Django]-How to test APIView in Django, Django Rest Framework

0👍

You need to compare the response data with your posted test data, that will be a good test for checking the posted data content. You may also check the order in which the response data is received, by using index response.data[0] for first item, and [1] for second and so on.
self.assertEqual(response.data[0].get(‘score’), self.result.score)

👤Maz

Leave a comment