'Helper function that checks that the response object
has a body with the provided error'

def expect_error(self, http_code, error_code_str, resp_obj):

    self.assertEqual(resp_obj.status_code, http_code)
    self.assertIn('error_code', resp_obj.data)
    self.assertEqual(resp_obj.data['error_code'], error_code_str)
