Skip to content

Commit

Permalink
Add test case to tests/test_course.py
Browse files Browse the repository at this point in the history
Was missing the test case when there were no student modules in the
course. We want to make sure our "empty set" handling is correct
  • Loading branch information
johnbaldwin committed Mar 15, 2022
1 parent bd03842 commit 2566818
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_course.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,11 @@ def test_enrollments_with_student_modules(self):
course = Course(self.course_overview.id)
found_ce = course.enrollments_with_student_modules()
assert set(found_ce) == set(ce[:2])

def test_enrollments_with_student_modules_but_no_student_modules(self):
ce = [CourseEnrollmentFactory(course_id=self.course_overview.id)
for _ in range(3)]

course = Course(self.course_overview.id)
assert not course.student_modules
assert not course.enrollments_with_student_modules()

0 comments on commit 2566818

Please sign in to comment.