def test_all_colleges(): assert len(College.all_college_names()) == 2
def colleges(): ah = AuthHelper(request) if ah.auth_will_succeed and ah.user.is_blueshirt: return json.dumps({"colleges": College.all_college_names()}) else: return ah.auth_error_json, 403
def colleges(requesting_user): if requesting_user.is_blueshirt: return json.dumps({"colleges": College.all_college_names()}) else: return AUTHORIZATION_DENIED
def test_all_colleges(): all_college_names = sorted(College.all_college_names()) assert all_college_names == ["college-1", "college-2"]
def colleges(requesting_user): if requesting_user.is_blueshirt: return json.dumps({"colleges":College.all_college_names()}) else: return AUTHORIZATION_DENIED
def colleges(): ah = AuthHelper(request) if ah.auth_will_succeed and ah.user.is_blueshirt: return json.dumps({"colleges":College.all_college_names()}) else: return ah.auth_error_json,403