Exemple #1
0
def test_verify_group__group_doesnt_exist(client, rf):
    req = rf.get("/test")

    resp = verify_group(req, "validation", 0)

    assert resp.status_code == 400
    assert resp.template_name == "400.html"
Exemple #2
0
def test_verify_group__teacher_doesnt_exist(client, rf, group, user):
    req = rf.get("/test")
    req.user = user

    resp = verify_group(req, "validation", group.pk)

    assert resp.status_code == 403
    assert resp.template_name == "403.html"
Exemple #3
0
def test_verify_group(client, rf, group, teacher):
    req = rf.get("/test")
    req.user = teacher.user

    group.teacher.add(teacher)

    resp = verify_group(req, "validation", group.pk)

    assert isinstance(resp, Quality)
Exemple #4
0
def test_verify_group__use_type_doesnt_exist(client, rf, group, teacher):
    req = rf.get("/test")
    req.user = teacher.user

    group.teacher.add(teacher)

    resp = verify_group(req, "fake", group.pk)

    assert resp.status_code == 400
    assert resp.template_name == "400.html"
Exemple #5
0
def test_verify_group__teacher_doesnt_have_access(client, rf, group, teacher):
    req = rf.get("/test")
    req.user = teacher.user

    group.teacher.remove(teacher)

    resp = verify_group(req, "validation", group.pk)

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