mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-25 19:14:11 +03:00
Doc clarification for headers arg in testing utils (#1117)
I think it might be helpful to add an explicit hint that HTTP headers should be prepended with `HTTP_` as required by `django.test.Client` (at least it was not super obvious to me when I tried to use it).
This commit is contained in:
parent
52880166bd
commit
beb2e4aae3
|
@ -28,7 +28,9 @@ def graphql_query(
|
||||||
variables (dict) - If provided, the "variables" field in GraphQL will be
|
variables (dict) - If provided, the "variables" field in GraphQL will be
|
||||||
set to this value.
|
set to this value.
|
||||||
headers (dict) - If provided, the headers in POST request to GRAPHQL_URL
|
headers (dict) - If provided, the headers in POST request to GRAPHQL_URL
|
||||||
will be set to this value.
|
will be set to this value. Keys should be prepended with
|
||||||
|
"HTTP_" (e.g. to specify the "Authorization" HTTP header,
|
||||||
|
use "HTTP_AUTHORIZATION" as the key).
|
||||||
client (django.test.Client) - Test client. Defaults to django.test.Client.
|
client (django.test.Client) - Test client. Defaults to django.test.Client.
|
||||||
graphql_url (string) - URL to graphql endpoint. Defaults to "/graphql".
|
graphql_url (string) - URL to graphql endpoint. Defaults to "/graphql".
|
||||||
|
|
||||||
|
@ -85,7 +87,9 @@ class GraphQLTestCase(TestCase):
|
||||||
variables (dict) - If provided, the "variables" field in GraphQL will be
|
variables (dict) - If provided, the "variables" field in GraphQL will be
|
||||||
set to this value.
|
set to this value.
|
||||||
headers (dict) - If provided, the headers in POST request to GRAPHQL_URL
|
headers (dict) - If provided, the headers in POST request to GRAPHQL_URL
|
||||||
will be set to this value.
|
will be set to this value. Keys should be prepended with
|
||||||
|
"HTTP_" (e.g. to specify the "Authorization" HTTP header,
|
||||||
|
use "HTTP_AUTHORIZATION" as the key).
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Response object from client
|
Response object from client
|
||||||
|
|
Loading…
Reference in New Issue
Block a user