Skip to content

APITestCase doesn't have credentials() to set token based authorization #9043

@cyapa

Description

@cyapa

Many sources describes how to set a token based authentication when testing requests as below but strangely credentials() is not defined anymore in APITestCase class?

self.client.credentials(HTTP_AUTHORIZATION='Bearer ' + JWT)

How come this method is missing from APITestCase? I m using the latest rest_framework

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