예제 #1
0
def test_verify_teacher__teacher_doesnt_exist(client, rf):
    req = rf.get("/test")

    resp = verify_teacher(req, "validation")

    assert resp.status_code == 403
    assert resp.template_name == "403.html"
예제 #2
0
def test_verify_teacher(client, rf, teacher):
    req = rf.get("/test")
    req.user = teacher.user

    resp = verify_teacher(req, "validation")

    assert isinstance(resp, Quality)
예제 #3
0
def test_verify_teacher__use_type_doesnt_exist(client, rf, teacher):
    req = rf.get("/test")
    req.user = teacher.user

    resp = verify_teacher(req, "fake")

    assert resp.status_code == 400
    assert resp.template_name == "400.html"