How to pass a cognito generated token while using graphene snapshot testing in django?
i'm just trying to pass HTTP_AUTHORIZATION token to test all my queries and mutations and just getting an error token has not been passed since it needs to get the context of logged in user, i just want to pass hard coded token for now in the Graphene test client query, Any leads appreciated , Thanks :) heres is what i'm trying to achieve:
class PostTest(TestCase):
def getAllPosts(self):
client = Client(schema)
self.assertMatchSnapshot(client.execute(
"""
query{
getPost(first:10){
edges{
node{
title
description
isLiked
}
}
}
}
""",
context = {"HTTP_AUTHORIZATION:"**HERE IS THE COGNITO GENERATED TOKEN**"}
))