mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-25 11:04: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
|
||||
set to this value.
|
||||
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.
|
||||
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
|
||||
set to this value.
|
||||
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:
|
||||
Response object from client
|
||||
|
|
Loading…
Reference in New Issue
Block a user