def test_instructor(self): self.assertRequestContainsAppx( "instructor-reviews", self.instructor1_pk, { **average_and_recent(3, 4), "courses": { "CIS-471": { **average_and_recent(3, 4), "full_code": "CIS-471", "code": "CIS-471", } }, }, ) self.assertRequestContainsAppx( "instructor-reviews", self.instructor2_pk, { **average_and_recent(1.5, 2), "courses": { "CIS-471": { **average_and_recent(1.5, 2), "full_code": "CIS-471", "code": "CIS-471", } }, }, )
def test_instructor(self): self.assertRequestContainsAppx( "instructor-reviews", Instructor.objects.get(name=self.instructor_name).pk, { **average_and_recent(3, 4), "courses": { "CIS-471": average_and_recent(3, 4) }, }, )
def test_course_old_code(self): self.assertRequestContainsAppx( "course-reviews", "CIS-371", { "num_semesters": 3, **average_and_recent(3, 4), **self.extra_course_data, "instructors": { Instructor.objects.get(name=self.instructor_name).pk: { **average_and_recent(3, 4), "latest_semester": TEST_SEMESTER, }, }, }, )
def test_department(self): self.assertRequestContainsAppx( "department-reviews", "CIS", { "courses": { "CIS-471": average_and_recent(2.25, 4) }, }, )
def test_course_old_code(self): self.assertRequestContainsAppx( "course-reviews", "CIS-371", { "num_semesters": 4, **average_and_recent(2.25, 4), **self.extra_course_data, "instructors": { self.instructor1_pk: { **average_and_recent(3, 4), "latest_semester": TEST_SEMESTER, }, self.instructor2_pk: { **average_and_recent(1.5, 2), "latest_semester": "2017A", }, }, }, )
def test_course(self): self.assertRequestContainsAppx( "course-reviews", "CIS-471", { "num_semesters": 3, **average_and_recent(2, 2), **self.extra_course_data, "instructors": { Instructor.objects.get(name=self.instructor_name).pk: { **average_and_recent(2, 2), "latest_semester": "2012A", }, Instructor.objects.get(name="Instructor Two").pk: { "average_reviews": {}, "recent_reviews": {}, "latest_semester": TEST_SEMESTER, }, }, }, )
def test_course(self): self.assertRequestContainsAppx( "course-reviews", "ARTH-2220", { "num_semesters": 1, **average_and_recent(4, 4), **self.extra_course_data_2220, "instructors": { Instructor.objects.get(name=self.instructor_name).pk: { **average_and_recent(4, 4), "latest_semester": TEST_SEMESTER, }, }, }, ) self.assertRequestContainsAppx( "course-reviews", "NELC-2055", { "num_semesters": 1, **average_and_recent(3, 3), **self.extra_course_data_2055, "instructors": { Instructor.objects.get(name=self.instructor_name).pk: { **average_and_recent(3, 3), "latest_semester": TEST_SEMESTER, }, }, }, ) self.assertRequestContainsAppx( "course-reviews", "ARTH-222", { "num_semesters": 1, **average_and_recent(2, 2), **self.extra_course_data_222, "instructors": { Instructor.objects.get(name=self.instructor_name).pk: { **average_and_recent(2, 2), "latest_semester": "2012A", }, }, }, )