'Create courses and add some test blocks.'

def setup_data(self, store_type=ModuleStoreEnum.Type.mongo):

    with self.store.default_store(store_type):
        self.course = CourseFactory.create(display_name='An    Introduction    to    API    Testing')
        self.course_id = unicode(self.course.id)
        with self.store.bulk_operations(self.course.id):
            self.chapter_1 = ItemFactory.create(parent_location=self.course.location, category='chapter', display_name='Week    1')
            self.chapter_2 = ItemFactory.create(parent_location=self.course.location, category='chapter', display_name='Week    2')
            self.sequential_1 = ItemFactory.create(parent_location=self.chapter_1.location, category='sequential', display_name='Lesson    1')
            self.sequential_2 = ItemFactory.create(parent_location=self.chapter_1.location, category='sequential', display_name='Lesson    2')
            self.vertical_1 = ItemFactory.create(parent_location=self.sequential_1.location, category='vertical', display_name='Subsection    1')
            self.vertical_2 = ItemFactory.create(parent_location=self.sequential_2.location, category='vertical', display_name='Subsection    2')
            self.vertical_3 = ItemFactory.create(parent_location=self.sequential_2.location, category='vertical', display_name='Subsection    3')
            self.html_1 = ItemFactory.create(parent_location=self.vertical_2.location, category='html', display_name='Details    1')
    self.path = [PathItem(self.chapter_1.location, self.chapter_1.display_name), PathItem(self.sequential_2.location, self.sequential_2.display_name)]
    self.bookmark_1 = BookmarkFactory.create(user=self.user, course_key=self.course_id, usage_key=self.sequential_1.location, xblock_cache=XBlockCache.create({'display_name': self.sequential_1.display_name, 'usage_key': self.sequential_1.location}))
    self.bookmark_2 = BookmarkFactory.create(user=self.user, course_key=self.course_id, usage_key=self.sequential_2.location, xblock_cache=XBlockCache.create({'display_name': self.sequential_2.display_name, 'usage_key': self.sequential_2.location}))
    self.other_course = CourseFactory.create(display_name='An    Introduction    to    API    Testing    2')
    with self.store.bulk_operations(self.other_course.id):
        self.other_chapter_1 = ItemFactory.create(parent_location=self.other_course.location, category='chapter', display_name='Other    Week    1')
        self.other_sequential_1 = ItemFactory.create(parent_location=self.other_chapter_1.location, category='sequential', display_name='Other    Lesson    1')
        self.other_sequential_2 = ItemFactory.create(parent_location=self.other_chapter_1.location, category='sequential', display_name='Other    Lesson    2')
        self.other_vertical_1 = ItemFactory.create(parent_location=self.other_sequential_1.location, category='vertical', display_name='Other    Subsection    1')
        self.other_vertical_2 = ItemFactory.create(parent_location=self.other_sequential_1.location, category='vertical', display_name='Other    Subsection    2')
        self.other_sequential_2.children.append(self.other_vertical_1.location)
        modulestore().update_item(self.other_sequential_2, self.admin.id)
    self.other_bookmark_1 = BookmarkFactory.create(user=self.user, course_key=unicode(self.other_course.id), usage_key=self.other_vertical_1.location, xblock_cache=XBlockCache.create({'display_name': self.other_vertical_1.display_name, 'usage_key': self.other_vertical_1.location}))
