Esempio n. 1
0
def test_all_colleges():
    assert len(College.all_college_names()) == 2
Esempio n. 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
Esempio n. 3
0
def colleges(requesting_user):
    if requesting_user.is_blueshirt:
        return json.dumps({"colleges": College.all_college_names()})
    else:
        return AUTHORIZATION_DENIED
Esempio n. 4
0
def test_all_colleges():
    all_college_names = sorted(College.all_college_names())
    assert all_college_names == ["college-1", "college-2"]
Esempio n. 5
0
def colleges(requesting_user):
    if requesting_user.is_blueshirt:
        return json.dumps({"colleges":College.all_college_names()})
    else:
        return AUTHORIZATION_DENIED
Esempio n. 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
Esempio n. 7
0
def test_all_colleges():
    assert len(College.all_college_names()) == 2