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_get_or_create__new(): data = new_students(1)[0] student, created = Student.get_or_create(**data) username = hashlib.md5(data["email"].encode()).hexdigest()[ :MAX_USERNAME_LENGTH ] assert isinstance(student, Student) assert created assert student.student.email == data["email"] assert student.student.username == username assert len(Student.objects.all()) == 1
def students(): _students = add_students(new_students(2)) for _student in _students: _student.student.is_active = True _student.student.save() return _students
def student(): _student = add_students(new_students(1))[0] _student.student.is_active = True _student.student.save() return _student
def students(): return add_students(new_students(3))
def student(): return add_students(new_students(1))[0]