recopytex/tests/model/test_assessment.py

27 lines
830 B
Python
Raw Normal View History

from random import choice, randint
from tests.model.fakes import build_questions
from .fakes import build_assessments, build_exercises, build_tribes
def test_assessement_register_exercise():
exercise_qty = randint(1, 10)
tribes = build_tribes(1)
assessments = build_assessments(tribes, 1)
exercises = build_exercises(assessments, 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 = build_tribes(1)
assessments = build_assessments(tribes, 1)
exercises = build_exercises(assessments, 1)
questions = build_questions(exercises, question_qty)
assert len(exercises[0].questions) == question_qty
assert exercises[0].questions == questions