'Test that deleting items from a course works even when present within a very large course'

def _do_test_large_course_deletion(self, store, load_factor):

    def id_list(top_parent_object):
        '    private    function    to    get    ids    from    object    down    the    tree    '
        list_of_ids = [unicode(top_parent_object.location)]
        for child in top_parent_object.get_children():
            list_of_ids.extend(id_list(child))
        return list_of_ids
    (course, course_size) = create_large_course(store, load_factor)
    self.course_id = unicode(course.id)
    CoursewareSearchIndexer.do_course_reindex(store, course.id)
    self.assert_search_count(course_size)
    course = store.get_course(course.id, depth=1)
    chapter_to_delete = course.get_children()[0]
    self.delete_item(store, chapter_to_delete.location)
    CoursewareSearchIndexer.do_course_reindex(store, course.id)
    deleted_count = (((1 + load_factor) + (load_factor ** 2)) + (load_factor ** 3))
    self.assert_search_count((course_size - deleted_count))
