Ejemplo n.º 1
0
def course_details(trans):
    course = factories.CourseFactory(id=1)
    section = factories.SectionFactory(course=course)
    ev = factories.EvaluationFactory(section=section,
                                     professor=section.professors[0])
    factories.VoteFactory(value=Vote.UPVOTE,
                          student=stash['student'],
                          evaluation=ev)
    db.session.commit()
Ejemplo n.º 2
0
def class_details(trans):
    q = factories.QuarterFactory(id=1)
    c = factories.CourseFactory(id=1)
    prof = factories.ProfessorFactory(id=1)
    factories.QuarterFactory.reset_sequence(2)
    factories.CourseFactory.reset_sequence(2)
    factories.ProfessorFactory.reset_sequence(2)
    factories.SectionFactory(quarter=q, course=c, professors=[prof])
    db.session.commit()
Ejemplo n.º 3
0
def professors(trans):
    prof = factories.ProfessorFactory()
    course = factories.CourseFactory(id=1)
    quarter = factories.QuarterFactory(id=1)
    section = factories.SectionFactory(course=course, quarter=quarter)
    ev = factories.EvaluationFactory(section=section, professor=prof)
    factories.VoteFactory(value=Vote.UPVOTE,
                          student=stash['student'],
                          evaluation=ev)
    db.session.commit()
Ejemplo n.º 4
0
def quarters(trans):
    now = datetime.now()
    start_prev = (now + timedelta(days=-10)).date()
    end_prev = (now + timedelta(days=-9)).date()

    quarter = factories.QuarterFactory(period=DateRange(start_prev, end_prev))
    factories.QuarterCurrentFactory()
    course = factories.CourseFactory(id=1)
    prof = factories.ProfessorFactory(id=1)
    factories.SectionFactory(quarter=quarter, course=course, professors=[prof])
    factories.QuarterFactory()
    db.session.commit()
Ejemplo n.º 5
0
def student_evaluations(trans):
    prof = factories.ProfessorFactory(id=1)
    course = factories.CourseFactory(id=1)
    quarter = factories.QuarterFactory(id=1)
    sec = factories.SectionFactory(quarter=quarter,
                                   course=course,
                                   professors=[prof])
    ev = factories.EvaluationFactory(section=sec,
                                     professor=prof,
                                     student=stash['student'])
    factories.VoteFactory(value=Vote.UPVOTE,
                          student=stash['student'],
                          evaluation=ev)
    db.session.commit()
Ejemplo n.º 6
0
def evaluations_submit(trans):
    prof = factories.ProfessorFactory(id=1)
    course = factories.CourseFactory(id=1)

    now = datetime.now()
    start_prev = (now - timedelta(days=10)).date()
    end_prev = (now + timedelta(days=10)).date()
    quarter = factories.QuarterFactory(id=1,
                                       period=DateRange(start_prev, end_prev))

    factories.QuarterFactory()

    factories.SectionFactory(quarter=quarter, course=course, professors=[prof])
    db.session.commit()
Ejemplo n.º 7
0
def courses(trans):
    factories.CourseFactory()
    db.session.commit()
Ejemplo n.º 8
0
def search(trans):
    factories.CourseFactory(title='Mathematics and Such')
    factories.ProfessorFactory(first_name='Matthew')
    db.session.commit()