Skip to content

Commit

Permalink
Fixes is_json flag for Django 3+
Browse files Browse the repository at this point in the history
  • Loading branch information
iMerica committed May 11, 2021
1 parent 882b5f8 commit e11bb64
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dj_rest_auth/tests/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ def send_request(self, request_method, *args, **kwargs):
kwargs['HTTP_AUTHORIZATION'] = 'Token %s' % self.token

self.response = request_func(*args, **kwargs)
is_json = bool(
[x for x in self.response._headers['content-type'] if 'json' in x])
is_json = 'application/json' in self.response.get('content-type')

self.response.json = {}
if is_json and self.response.content:
Expand Down

0 comments on commit e11bb64

Please sign in to comment.