From 43c4a1fedb875a2e82e5a5fd3d0f3f0ab10a5c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87a=C4=9F=C4=B1l?= Date: Wed, 25 Apr 2018 19:11:15 +0100 Subject: [PATCH] Update - RequestsClient needs fully qualified URLs Note that the requests client requires you to pass fully qualified URLs. --- docs/api-guide/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/testing.md b/docs/api-guide/testing.md index 47d6887c7..5f27c23e4 100644 --- a/docs/api-guide/testing.md +++ b/docs/api-guide/testing.md @@ -238,12 +238,12 @@ For example... client = RequestsClient() # Obtain a CSRF token. - response = client.get('/homepage/') + response = client.get('http://testserver/homepage/') assert response.status_code == 200 csrftoken = response.cookies['csrftoken'] # Interact with the API. - response = client.post('/organisations/', json={ + response = client.post('http://testserver/organisations/', json={ 'name': 'MegaCorp', 'status': 'active' }, headers={'X-CSRFToken': csrftoken})