'Create good courses, courses that won\'t load, and deleted courses which still have
roles. Test course listing.'

@ddt.data(ModuleStoreEnum.Type.split, ModuleStoreEnum.Type.mongo)
def test_course_listing_errored_deleted_courses(self, store):

    with self.store.default_store(store):
        course_location = self.store.make_course_key('testOrg', 'testCourse', 'RunBabyRun')
        self._create_course_with_access_groups(course_location, self.user, store)
        course_location = self.store.make_course_key('testOrg', 'doomedCourse', 'RunBabyRun')
        self._create_course_with_access_groups(course_location, self.user, store)
        self.store.delete_course(course_location, self.user.id)
    (courses_list, __) = _accessible_courses_list_from_groups(self.request)
    self.assertEqual(len(courses_list), 1, courses_list)
