mardi 31 octobre 2017

python aseertJSONEqual see output with 'info' and "info" as different output

when I print expected_order_data it gives:

{'rating': 0.0, 'first_name': 'Debbie', 'last_name': 'Graves', 'user_id': 1, 'car': {'photo': [], 'make': 'Nissan', 'plates_number': '', 'model': 'March', 'year': ''}, 'avatar': 'path', 'cab_number': '1'}

response.content gives:

{"rating": 0.0, "first_name": "Debbie", "last_name": "Graves", "user_id": 1, "car": {"photo": [], "make": "Nissan", "plates_number": "", "model": "March", "year": ""}, "avatar": "path", "cab_number": "1"}

But when I do

self.assertJSONEqual(response.content, expected_order_data)

I got TypeError: expected string or buffer mistake

Aucun commentaire:

Enregistrer un commentaire