def test_all_colleges():
    assert len(College.all_college_names()) == 2
Exemple #2
0
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
Exemple #3
0
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"]
Exemple #5
0
def colleges(requesting_user):
    if requesting_user.is_blueshirt:
        return json.dumps({"colleges":College.all_college_names()})
    else:
        return AUTHORIZATION_DENIED
Exemple #6
0
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
Exemple #7
0
def test_all_colleges():
    assert len(College.all_college_names()) == 2