Пример #1
0
    def test_instructor_paced_discussion_xblock_visibility(self):
        """
        Verify that discussion xblocks scheduled for release in the future are
        not visible to students in an instructor-paced course.
        """
        course, section = self.setup_course(start=self.now, self_paced=False)
        self.create_discussion_xblocks(section)

        # Only the released xblocks should be visible when the course is instructor-paced.
        xblocks = get_accessible_discussion_xblocks(course,
                                                    self.non_staff_user)
        self.assertTrue(
            all(xblock.display_name == 'released' for xblock in xblocks))
    def test_instructor_paced_discussion_xblock_visibility(self):
        """
        Verify that discussion xblocks scheduled for release in the future are
        not visible to students in an instructor-paced course.
        """
        course, section = self.setup_course(start=self.now, self_paced=False)
        self.create_discussion_xblocks(section)

        # Only the released xblocks should be visible when the course is instructor-paced.
        xblocks = get_accessible_discussion_xblocks(course, self.non_staff_user)
        self.assertTrue(
            all(xblock.display_name == 'released' for xblock in xblocks)
        )
Пример #3
0
    def test_self_paced_discussion_xblock_visibility(self):
        """
        Regression test. Verify that discussion xblocks scheduled for release
        in the future are visible to students in a self-paced course.
        """
        course, section = self.setup_course(start=self.now, self_paced=True)
        self.create_discussion_xblocks(section)

        # The scheduled xblocks should be visible when the course is self-paced.
        xblocks = get_accessible_discussion_xblocks(course,
                                                    self.non_staff_user)
        self.assertEqual(len(xblocks), 2)
        self.assertTrue(
            any(xblock.display_name == 'scheduled' for xblock in xblocks))
    def test_self_paced_discussion_xblock_visibility(self):
        """
        Regression test. Verify that discussion xblocks scheduled for release
        in the future are visible to students in a self-paced course.
        """
        course, section = self.setup_course(start=self.now, self_paced=True)
        self.create_discussion_xblocks(section)

        # The scheduled xblocks should be visible when the course is self-paced.
        xblocks = get_accessible_discussion_xblocks(course, self.non_staff_user)
        self.assertEqual(len(xblocks), 2)
        self.assertTrue(
            any(xblock.display_name == 'scheduled' for xblock in xblocks)
        )