[As per https://stackoverflow.com/a/46369945/1021819, the title should refer to integration tests rather than unit tests]
Suppose I\'d like to test the foll
With Python3, I got the error TypeError: the JSON object must be str, not bytes. It is required to decode:
TypeError: the JSON object must be str, not bytes
# in TestFlaskApi.test_hello_world self.assertEqual(json.loads(response.get_data().decode()), {'hello': 'world'})
This question gives an explanation.