Skip to content

How to test APIs that require JWT? #824

Closed
@prabhupant

Description

@prabhupant

I have been following the code as mentioned in the docs here but its not working.I have the following issues/questions-

  1. As Django carries testing in an ephemeral database, how can I create a user so that I can validate JWT auth in all the APIs? This is the error log of a test query
404                                                                                                                                                                                                                
functools.partial(<bound method Client._parse_json of <django.test.client.Client object at 0x7f0c87fb70f0>>, <HttpResponseNotFound status_code=404, "text/html">)
  1. The test_query_with_variables function is not working and throws this error
    TypeError: query() got an unexpected keyword argument 'variables'

Please help with testing APIs that need JWT auth and also how to write test cases for them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions