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

@ddt.data((ModuleStoreEnum.Type.split, 'xmodule.modulestore.split_mongo.split_mongo_kvs.SplitMongoKVS'), (ModuleStoreEnum.Type.mongo, 'xmodule.modulestore.mongo.base.MongoKeyValueStore'))
@ddt.unpack
def test_errored_course_global_staff(self, store, path_to_patch):

    GlobalStaff().add_users(self.user)
    with self.store.default_store(store):
        course_key = self.store.make_course_key('Org1', 'Course1', 'Run1')
        self._create_course_with_access_groups(course_key, self.user, store=store)
        with patch(path_to_patch, Mock(side_effect=Exception)):
            self.assertIsInstance(self.store.get_course(course_key), ErrorDescriptor)
            (courses_iter, __) = _accessible_courses_iter(self.request)
            self.assertEqual(list(courses_iter), [])
            (courses_list_by_groups, __) = _accessible_courses_list_from_groups(self.request)
            self.assertEqual(courses_list_by_groups, [])
