def test_json_data_raises_error_with_bad_unicode_dataset(self, handle_req, bad_response, app): with app.test_request_context(): handle_req.return_value = bad_response resp = view.search_json('db') assert resp.status_code == 500
def test_correct_json_data_included_with_successful_query(self, handle_req, search_response, app): with app.test_request_context(): handle_req.return_value = search_response res = view.search_json("db") resp_data = json.loads(res.data)["data"] original_data = json.loads(search_response[1].to_json())["data"] assert resp_data == original_data
def test_correct_json_data_included_with_successful_query( self, handle_req, search_response, app): with app.test_request_context(): handle_req.return_value = search_response res = view.search_json('db') resp_data = json.loads(res.data)['data'] original_data = json.loads(search_response[1].to_json())['data'] assert resp_data == original_data
def test_json_data_raises_error_with_bad_unicode_dataset(self, handle_req, bad_response, app): with app.test_request_context(): handle_req.return_value = bad_response resp = view.search_json("db") assert resp.status_code == 500