"""Helper methods for use in the tests.""" import json def get_message(response): """Extract the message field from a JSON response.""" return get_json_body(response).get('message') def get_json_body(response): """Extract the JSON body from a response.""" return json.loads(response.data.decode())