'Test the course list for regular staff when get_course returns an ErrorDescriptor'

def test_errored_course_regular_access(self):

    mongo_store = modulestore()._get_modulestore_by_type(ModuleStoreEnum.Type.mongo)
    course_key = mongo_store.make_course_key('Org1', 'Course1', 'Run1')
    self._create_course_with_access_groups(course_key, default_store=ModuleStoreEnum.Type.mongo)
    with mock.patch('xmodule.modulestore.mongo.base.MongoKeyValueStore', mock.Mock(side_effect=Exception)):
        self.assertIsInstance(modulestore().get_course(course_key), ErrorDescriptor)
        CourseOverview.objects.filter(id=course_key).delete()
        courses_list = list(get_course_enrollments(self.student, None, []))
        self.assertEqual(courses_list, [])
