mirror of
https://github.com/sprockets/sprockets.mixins.json_error.git
synced 2024-11-25 11:19:52 +00:00
Fix Py3 encoding failures in tests.py.
This commit is contained in:
parent
f3674bf273
commit
0e6f9431ec
1 changed files with 3 additions and 3 deletions
6
tests.py
6
tests.py
|
@ -46,7 +46,7 @@ class TestHTTPError(testing.AsyncHTTPTestCase):
|
||||||
def test_tornado_thrown_exception(self):
|
def test_tornado_thrown_exception(self):
|
||||||
response = self.fetch('/')
|
response = self.fetch('/')
|
||||||
expected = {'message': 'Unexpected Error', 'type': 'Bad Request'}
|
expected = {'message': 'Unexpected Error', 'type': 'Bad Request'}
|
||||||
self.assertEqual(json.loads(response.body), expected)
|
self.assertEqual(json.loads(response.body.decode('utf-8')), expected)
|
||||||
|
|
||||||
|
|
||||||
class TestCustomExceptions(testing.AsyncHTTPTestCase):
|
class TestCustomExceptions(testing.AsyncHTTPTestCase):
|
||||||
|
@ -61,7 +61,7 @@ class TestCustomExceptions(testing.AsyncHTTPTestCase):
|
||||||
'type': 'FailureError',
|
'type': 'FailureError',
|
||||||
'documentation_url': 'http://www.example.com',
|
'documentation_url': 'http://www.example.com',
|
||||||
}
|
}
|
||||||
self.assertEqual(json.loads(response.body), expected)
|
self.assertEqual(json.loads(response.body.decode('utf-8')), expected)
|
||||||
|
|
||||||
|
|
||||||
class TestUnexpectedError(testing.AsyncHTTPTestCase):
|
class TestUnexpectedError(testing.AsyncHTTPTestCase):
|
||||||
|
@ -75,4 +75,4 @@ class TestUnexpectedError(testing.AsyncHTTPTestCase):
|
||||||
'message': 'Unexpected Error',
|
'message': 'Unexpected Error',
|
||||||
'type': 'Internal Server Error'
|
'type': 'Internal Server Error'
|
||||||
}
|
}
|
||||||
self.assertEqual(json.loads(response.body), expected)
|
self.assertEqual(json.loads(response.body.decode('utf-8')), expected)
|
||||||
|
|
Loading…
Reference in a new issue