jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 650 forks source link

Test for protected endpoint fail, authorization header is provided #430

Closed dnutiu closed 6 years ago

dnutiu commented 6 years ago

I'm trying to write tests for successful login but the test seem to fail...

        response = self.client.get(self.sample_protected_endpoint, data, content_type='application/json',
                                   AUTHORIZATION="JWT {}".format(token))

        self.assertEqual(response.status_code, status.HTTP_200_OK)
dnutiu commented 6 years ago

Should have read the tests before creating this.

response = client.post(
            '/auth-token/', self.data,
            HTTP_AUTHORIZATION=auth, format='json')