Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
def students():
    _students = add_students(new_students(2))
    for _student in _students:
        _student.student.is_active = True
        _student.student.save()
    return _students
Ejemplo n.º 6
0
def student():
    _student = add_students(new_students(1))[0]
    _student.student.is_active = True
    _student.student.save()
    return _student
Ejemplo n.º 7
0
def students():
    return add_students(new_students(3))
Ejemplo n.º 8
0
def student():
    return add_students(new_students(1))[0]