I noticed that when I create a handler
newClient = APIClient(enforce_csrf_checks=True)
that
newClient.enforce_csrf_checks = False
but
newClient.handler.enforce_csrf_checks = True
What is the difference? I ask this because I have an existing API Client and I want to know the difference:
class ModifyTest(APITestCase):
def setUp(self):
self.client.enforce_csrf_checks = True # Do this?
self.client.handler.enforce_csrf_checks = True # Or Do this?
Aucun commentaire:
Enregistrer un commentaire