def _install_course_fixture(self):
        """ Install the course fixture that has been defined """
        if self.assets:
            self.course_fixture.add_asset(self.assets)

        chapter_sequential = XBlockFixtureDesc('sequential', 'Test Section')
        chapter_sequential.add_children(*self._add_course_verticals())
        chapter = XBlockFixtureDesc('chapter', 'Test Chapter').add_children(chapter_sequential)
        self.course_fixture.add_children(chapter)
        self.course_fixture.install()

        if len(self.youtube_configuration) > 0:
            YouTubeStubConfig.configure(self.youtube_configuration)
Example #2
0
    def _install_course_fixture(self):
        """ Install the course fixture that has been defined """
        if self.assets:
            self.course_fixture.add_asset(self.assets)

        chapter_sequential = XBlockFixtureDesc('sequential', 'Test Section')
        chapter_sequential.add_children(*self._add_course_verticals())
        chapter = XBlockFixtureDesc('chapter', 'Test Chapter').add_children(chapter_sequential)
        self.course_fixture.add_children(chapter)
        self.course_fixture.install()

        if len(self.youtube_configuration) > 0:
            YouTubeStubConfig.configure(self.youtube_configuration)
    def _create_single_vertical(self, vertical_contents, vertical_index):
        """
        Create a single course vertical of type XBlockFixtureDesc with category `vertical`.
        A single course vertical can contain single or multiple video modules.
        :param vertical_contents: a list of items for the vertical to contain
        :param vertical_index: index for the vertical display name
        :return: XBlockFixtureDesc
        """
        xblock_course_vertical = XBlockFixtureDesc('vertical', u'Test Vertical-{0}'.format(vertical_index))

        for video in vertical_contents:
            xblock_course_vertical.add_children(
                XBlockFixtureDesc('video', video['display_name'], metadata=video.get('metadata')))

        return xblock_course_vertical
Example #4
0
    def _create_single_vertical(self, vertical_contents, vertical_index):
        """
        Create a single course vertical of type XBlockFixtureDesc with category `vertical`.
        A single course vertical can contain single or multiple video modules.
        :param vertical_contents: a list of items for the vertical to contain
        :param vertical_index: index for the vertical display name
        :return: XBlockFixtureDesc
        """
        xblock_course_vertical = XBlockFixtureDesc('vertical', 'Test Vertical-{0}'.format(vertical_index))

        for video in vertical_contents:
            xblock_course_vertical.add_children(
                XBlockFixtureDesc('video', video['display_name'], metadata=video.get('metadata')))

        return xblock_course_vertical
Example #5
0
class TestCourseBadExport(BadExportMixin, StudioCourseTest):
    """
    Verify exporting a bad course causes an error.
    """
    ready_method = 'wait_for_component_menu'

    def setUp(self):  # pylint: disable=arguments-differ
        super(TestCourseBadExport, self).setUp()
        self.export_page = ExportCoursePage(
            self.browser,
            self.course_info['org'], self.course_info['number'], self.course_info['run'],
        )
        self.edit_page = ContainerPage(self.browser, self.unit.locator)
        self.export_page.visit()

    def populate_course_fixture(self, course_fixture):
        """
        Populate the course with a unit that has a bad problem.
        """
        self.unit = XBlockFixtureDesc('vertical', 'Unit')
        course_fixture.add_children(
            XBlockFixtureDesc('chapter', 'Main Section').add_children(
                XBlockFixtureDesc('sequential', 'Subsection').add_children(
                    self.unit.add_children(
                        XBlockFixtureDesc("problem", "Bad Problem", data='<')
                    )
                )
            )
        )
Example #6
0
class TestCourseBadExport(BadExportMixin, StudioCourseTest):
    """
    Verify exporting a bad course causes an error.
    """

    ready_method = "wait_for_component_menu"

    def setUp(self):  # pylint: disable=arguments-differ
        super(TestCourseBadExport, self).setUp()
        self.export_page = ExportCoursePage(
            self.browser, self.course_info["org"], self.course_info["number"], self.course_info["run"]
        )
        self.edit_page = ContainerPage(self.browser, self.unit.locator)
        self.export_page.visit()

    def populate_course_fixture(self, course_fixture):
        """
        Populate the course with a unit that has a bad problem.
        """
        self.unit = XBlockFixtureDesc("vertical", "Unit")
        course_fixture.add_children(
            XBlockFixtureDesc("chapter", "Main Section").add_children(
                XBlockFixtureDesc("sequential", "Subsection").add_children(
                    self.unit.add_children(XBlockFixtureDesc("problem", "Bad Problem", data="<"))
                )
            )
        )
 def populate_course_fixture(self, course_fixture):
     """
     Create a course with a single chapter.
     That chapter has a single section.
     That section has a single vertical.
     That vertical has a single video element.
     """
     video_block = XBlockFixtureDesc('video', "Test Video")
     vertical = XBlockFixtureDesc('vertical', "Test Vertical")
     vertical.add_children(video_block)
     sequential = XBlockFixtureDesc('sequential', "Test Section")
     sequential.add_children(vertical)
     chapter = XBlockFixtureDesc('chapter', "Test Chapter")
     chapter.add_children(sequential)
     self.course_fixture.add_children(chapter)
 def populate_course_fixture(self, course_fixture):
     """
     Create a course with a single chapter.
     That chapter has a single section.
     That section has a single vertical.
     That vertical has a single video element.
     """
     video_block = XBlockFixtureDesc('video', "Test Video")
     vertical = XBlockFixtureDesc('vertical', "Test Vertical")
     vertical.add_children(video_block)
     sequential = XBlockFixtureDesc('sequential', "Test Section")
     sequential.add_children(vertical)
     chapter = XBlockFixtureDesc('chapter', "Test Chapter")
     chapter.add_children(sequential)
     self.course_fixture.add_children(chapter)