Beispiel #1
0
 def test_get_all_courses(self):
     f = CourseOverviewFilter(queryset=CourseOverview.objects.all())
     self.assertQuerysetEqual(
         f.qs,
         [o.id for o in self.course_overviews],
         lambda o: o.id,
         ordered=False)
Beispiel #2
0
 def test_filter_exact_number(self):
     f = CourseOverviewFilter(queryset=CourseOverview.objects.filter(
         number='A001'))
     self.assertQuerysetEqual(
         f.qs, [o.id for o in self.course_overviews if o.number == 'A001'],
         lambda o: o.id,
         ordered=False)
Beispiel #3
0
 def test_filter_number_contains(self):
     f = CourseOverviewFilter(queryset=CourseOverview.objects.filter(
         number__contains='001'))
     self.assertQuerysetEqual(
         f.qs, [o.id for o in self.course_overviews if '001' in o.number],
         lambda o: o.id,
         ordered=False)
Beispiel #4
0
 def test_filter_exact_org(self):
     f = CourseOverviewFilter(queryset=CourseOverview.objects.filter(
         org='Alpha'))
     self.assertQuerysetEqual(
         f.qs, [o.id for o in self.course_overviews if o.org == 'Alpha'],
         lambda o: o.id,
         ordered=False)