Esempio n. 1
0
def get_reputation_criteria_list(req):
    used_criteria = [
        criterion.name for criterion in UsesCriterion.objects.filter(
            reputation_type__type="teacher")
    ]
    criteria = [
        get_criterion(criterion).general_info() for criterion in used_criteria
    ]
    data = {"criteria": criteria}
    return JsonResponse(data)
Esempio n. 2
0
def test_get_criterion__wrong():
    with pytest.raises(CriterionDoesNotExistError):
        criterion = get_criterion("fake_critertion")
Esempio n. 3
0
def test_get_criterion():
    for criterion in criteria:
        criterion_ = get_criterion(criterion)
        assert issubclass(criterion_, Criterion)
        assert hasattr(criterion_, "name")
        assert hasattr(criterion_, "evaluate")