recopytex/tests/model/test_assessment.py

30 lines
792 B
Python
Raw Normal View History

from random import choice, randint
from .fakes import (
build_tribe_assessment_exercise,
build_tribe_assessment_exercise_question,
)
def test_assessement_register_exercise():
exercise_qty = randint(1, 10)
tribes, assessments, exercises = build_tribe_assessment_exercise(
exercise_per_assessment=exercise_qty
)
assert len(assessments[0].exercises) == exercise_qty
assert assessments[0].exercises == exercises
def test_exercise_register_question():
question_qty = randint(1, 10)
(
tribes,
assessments,
exercises,
questions,
) = build_tribe_assessment_exercise_question(question_per_exercise=question_qty)
assert len(exercises[0].questions) == question_qty
assert exercises[0].questions == questions