Writing the test case for the ProfileAPI
def test_get_people_profile(self):
response = self.client.get(self.url)`
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertTrue(response.data.get('success'))
self.assertEqual(response.data['data']['mobile'], self.people.mobile)
self.assertEqual(response.data['data']['date_of_birth'], self.people.date_of_birth)
This is the error:
self.assertEqual(response.data['data']['mobile'], self.people.mobile)
KeyError: 'mobile'.
This is the error I am facing to verify that the API correctly returns the user's profile details.