'Test getting courses'

@unittest.skipUnless((settings.ROOT_URLCONF == 'lms.urls'), 'Test    only    valid    in    lms')
def test_get_course_list(self):

    course_location = self.store.make_course_key('Org1', 'Course1', 'Run1')
    self._create_course_with_access_groups(course_location)
    courses_list = list(get_course_enrollments(self.student, None, []))
    self.assertEqual(len(courses_list), 1)
    self.assertEqual(courses_list[0].course_id, course_location)
    CourseEnrollment.unenroll(self.student, course_location)
    courses_list = list(get_course_enrollments(self.student, None, []))
    self.assertEqual(len(courses_list), 0)
