def courses_top(trans): s1 = factories.SectionFactory() s2 = factories.SectionFactory() factories.EvaluationFactory(section=s1) factories.EvaluationFactory(section=s1) factories.EvaluationFactory(section=s2) db.session.commit()
def professors_top(trans): p1 = factories.ProfessorFactory() p2 = factories.ProfessorFactory() s1 = factories.SectionFactory(professors=[p1]) s2 = factories.SectionFactory(professors=[p2]) factories.EvaluationFactory(section=s1, professor=p1) factories.EvaluationFactory(section=s2, professor=p2) db.session.commit()
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()
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()
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()
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()
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()
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()
def professor_details(trans): prof = factories.ProfessorFactory(id=1) factories.SectionFactory(professors=[prof]) db.session.commit()