Closed
Description
- What is the current behavior?
Trying to send headers using GraphQLTestCase doesn't work. This is my test:
class TestCase(GraphQLTestCase):
def test(self):
response = self.query(
'''
query {
puzzles {
id
title
}
}
''',
headers={
'Some-Header': 'test,
},
)
self.assertResponseNoErrors(valid_response)
and if I try to log those headers in my code I get None
. However if I follow the code to graphene_django/utils/testing.py
and change line 58 from:
resp = client.post(
graphql_url, json.dumps(body), content_type="application/json", **headers
)
to
resp = client.post(
graphql_url, json.dumps(body), content_type="application/json", headers=headers
)
Then it works fine.
-
Please tell us about your environment:
- Version:
python = "^3.11"
django = "^4.2.1"
graphene-django = "^3.1.1"
- Platform: Ubuntu