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 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 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 courses(trans): factories.CourseFactory() db.session.commit()
def search(trans): factories.CourseFactory(title='Mathematics and Such') factories.ProfessorFactory(first_name='Matthew') db.session.commit()