Skip to content

Commit

Permalink
Don't use response.json() as it's not available on Django 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Feb 9, 2017
1 parent 2435550 commit afc224e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test_runner/blog/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_list(self):

# change the format to json
response = self.client.get(reverse('blog.post_list') + "?_format=json")
self.assertEqual(response.json(), [
self.assertEqual(json.loads(response.content.decode("utf-8")), [
{'tags': 'post', 'title': 'A First Post', 'body': 'Apples'},
{'tags': 'post', 'title': 'A Fourth Post', 'body': 'Oranges'},
{'tags': 'post', 'title': 'A Second Post', 'body': 'Oranges'},
Expand All @@ -231,7 +231,7 @@ def test_list(self):

# change the format to select2
response = self.client.get(reverse('blog.post_list') + "?_format=select2")
self.assertEqual(response.json(), {
self.assertEqual(json.loads(response.content.decode("utf-8")), {
'results': [
{'id': post1.id, 'text': 'A First Post'},
{'id': post4.id, 'text': 'A Fourth Post'},
Expand Down

0 comments on commit afc224e

Please sign in to comment.