mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-02-11 23:40:36 +03:00
Alter a statement to make it python3 compatible
- In python 3, filter returns an iterator instead of a list - Thus bool(filter(...)) always evaluated to true on python3 - Convert the filter to a list comprehension to ensure it evaluated as expected on python 3
This commit is contained in:
parent
ba5edbaf62
commit
7fbdcff5e0
|
@ -49,7 +49,7 @@ class BaseAPITestCase(object):
|
||||||
|
|
||||||
self.response = request_func(*args, **kwargs)
|
self.response = request_func(*args, **kwargs)
|
||||||
is_json = bool(
|
is_json = bool(
|
||||||
filter(lambda x: 'json' in x, self.response._headers['content-type']))
|
[x for x in self.response._headers['content-type'] if 'json' in x])
|
||||||
if is_json and self.response.content:
|
if is_json and self.response.content:
|
||||||
self.response.json = json.loads(self.response.content)
|
self.response.json = json.loads(self.response.content)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user