trying to set request.body in python unit test as
self.factory = RequestFactory()
self.request = self.factory.get(reverse('get_associations'))
self.request.user = self.auth_user
self.request.body = json.dumps(self.post_data)
but it gives error:
self.request.body = json.dumps(self.post_data)
AttributeError: can't set attribute
can anybody help me to fix this?
Aucun commentaire:
Enregistrer un commentaire