'Helper method to create the course.'

def setup_course(self, default_store=None):

    if (not default_store):
        default_store = self.store.default_modulestore.get_modulestore_type()
    self.course = CourseFactory.create(default_store=default_store)
    self.course.user_partitions = [UserPartition(0, 'first_partition', 'Test    Partition', [Group('0', 'alpha'), Group('1', 'beta')])]
    self.store.update_item(self.course, self.user.id)
    chap1 = self.create_xblock(parent_usage_key=self.course.location, display_name='chapter1', category='chapter')
    self.chapter_usage_key = self.response_usage_key(chap1)
    chap2 = self.create_xblock(parent_usage_key=self.course.location, display_name='chapter2', category='chapter')
    self.chapter2_usage_key = self.response_usage_key(chap2)
    seq1 = self.create_xblock(parent_usage_key=self.chapter_usage_key, display_name='seq1', category='sequential')
    self.seq_usage_key = self.response_usage_key(seq1)
    seq2 = self.create_xblock(parent_usage_key=self.chapter_usage_key, display_name='seq2', category='sequential')
    self.seq2_usage_key = self.response_usage_key(seq2)
    vert1 = self.create_xblock(parent_usage_key=self.seq_usage_key, display_name='vertical1', category='vertical')
    self.vert_usage_key = self.response_usage_key(vert1)
    vert2 = self.create_xblock(parent_usage_key=self.seq_usage_key, display_name='vertical2', category='vertical')
    self.vert2_usage_key = self.response_usage_key(vert2)
    problem1 = self.create_xblock(parent_usage_key=self.vert_usage_key, display_name='problem1', category='problem')
    self.problem_usage_key = self.response_usage_key(problem1)
    html1 = self.create_xblock(parent_usage_key=self.vert_usage_key, display_name='html1', category='html')
    self.html_usage_key = self.response_usage_key(html1)
    resp = self.create_xblock(category='split_test', parent_usage_key=self.vert_usage_key)
    self.split_test_usage_key = self.response_usage_key(resp)
