'Create courses and enrollments.
Created courses and enrollments are stored in instance variables
so tests can refer to them later.
Arguments:
*args: Tuples of (course_org, should_enroll), where
course_org is the name of the org in the course key
and should_enroll is a boolean indicating whether to enroll
the user in the course.
Returns:
None'

def _create_courses_and_enrollments(self, *args):

    for (course_number, (course_org, should_enroll)) in enumerate(args):
        course = CourseFactory.create(org=course_org, number=str(course_number))
        if should_enroll:
            enrollment = CourseEnrollmentFactory.create(is_active=True, course_id=course.id, user=self.user)
            self.enrollments[course.id].append(enrollment)
        self.courses.append(course)
