def students_with_assignment(student_group_assignment): students = add_students(new_students(20)) add_to_group(students, student_group_assignment.group) add_student_assignments( new_student_assignments( len(students), student_group_assignment, students ) ) return students
def students_with_assignments(student_group_assignments): students = add_students(new_students(20)) add_to_group(students, [a.group for a in student_group_assignments]) add_student_assignments( new_student_assignments( len(students) * len(student_group_assignments), student_group_assignments, students, )) return students
def students_with_assignment_all_answers_correct( student_group_assignment_all_answers_correct ): students = add_students(new_students(20)) add_to_group(students, student_group_assignment_all_answers_correct.group) add_student_assignments( new_student_assignments( len(students), student_group_assignment_all_answers_correct, students, ) ) return students
def test_update_students(student_group_assignment, students, celery_worker): add_to_group(students, student_group_assignment.group) for student in students: assert not StudentAssignment.objects.filter( student=student, group_assignment=student_group_assignment).exists() student_group_assignment.update_students() for student in students: assert StudentAssignment.objects.filter( student=student, group_assignment=student_group_assignment).exists() assert len(mail.outbox) == len(students)
def student_assignment(student, group_assignment): add_to_group(student, group_assignment.group) return add_student_assignments( new_student_assignments(1, group_assignment, student))[0]