Skip to content

Commit

Permalink
Decode JSON content consistently in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmiller committed Jan 7, 2018
1 parent 4cef14b commit 3982127
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opal/tests/test_api.py
Expand Up @@ -372,7 +372,7 @@ def test_update_no_consistency_token(self):
}
mock_request.user = self.user
response = self.viewset().update(mock_request, pk=colour.pk)
message = json.loads(response.content)
message = json.loads(response.content.decode('UTF-8'))
self.assertEqual(message['error'], 'Missing consistency token')

def test_delete(self):
Expand Down Expand Up @@ -848,7 +848,7 @@ def test_update_missing_consistency_token(self):
"start": "14/01/2015"
}
response = api.EpisodeViewSet().update(self.mock_request, pk=e.pk)
message = json.loads(response.content)
message = json.loads(response.content.decode('UTF-8'))
self.assertEqual(message['error'], 'Missing consistency token')
self.assertEqual(400, response.status_code)

Expand Down

0 comments on commit 3982127

Please sign in to comment.