'Create a set of pages with XBlocks on them. For now, we restrict
ourselves to one block per learning sequence.'

@classmethod
def setUpClass(cls):

    super(XBlockScenarioTestCaseMixin, cls).setUpClass()
    cls.course = CourseFactory.create(display_name='XBlock_Test_Course')
    cls.scenario_urls = {}
    cls.xblocks = {}
    with cls.store.bulk_operations(cls.course.id, emit_signals=False):
        for chapter_config in cls.test_configuration:
            chapter = ItemFactory.create(parent=cls.course, display_name=('ch_' + chapter_config['urlname']), category='chapter')
            section = ItemFactory.create(parent=chapter, display_name=('sec_' + chapter_config['urlname']), category='sequential')
            unit = ItemFactory.create(parent=section, display_name=('unit_' + chapter_config['urlname']), category='vertical')
            if (len(chapter_config['xblocks']) > 1):
                raise NotImplementedError('We    only    support    one    block    per    page.    We    will    do    more    with    OLX+learning    sequence    cleanups.')
            for xblock_config in chapter_config['xblocks']:
                xblock = ItemFactory.create(parent=unit, category=xblock_config['blocktype'], display_name=xblock_config['urlname'], **xblock_config.get('parameters', {}))
                cls.xblocks[xblock_config['urlname']] = xblock
            scenario_url = unicode(reverse('courseware_section', kwargs={'course_id': unicode(cls.course.id), 'chapter': ('ch_' + chapter_config['urlname']), 'section': ('sec_' + chapter_config['urlname'])}))
            cls.scenario_urls[chapter_config['urlname']] = scenario_url
