Exemple #1
0
    def test_get_cms_course_block_link(self):
        """
        Tests that get_cms_course_link_by_id and get_cms_block_link_by_id return the right thing
        """
        self.course = CourseFactory.create(  # lint-amnesty, pylint: disable=attribute-defined-outside-init
            org='org', number='num', display_name='name'
        )

        cms_url = f"//{CMS_BASE_TEST}/course/{str(self.course.id)}"
        assert cms_url == get_cms_course_link(self.course)
        cms_url = f"//{CMS_BASE_TEST}/course/{str(self.course.location)}"
        assert cms_url == get_cms_block_link(self.course, 'course')
Exemple #2
0
    def test_get_cms_course_block_link(self):
        """
        Tests that get_cms_course_link_by_id and get_cms_block_link_by_id return the right thing
        """
        self.course = CourseFactory.create(
            org='org', number='num', display_name='name'
        )

        cms_url = u"//{}/course/{}".format(CMS_BASE_TEST, six.text_type(self.course.id))
        self.assertEqual(cms_url, get_cms_course_link(self.course))
        cms_url = u"//{}/course/{}".format(CMS_BASE_TEST, six.text_type(self.course.location))
        self.assertEqual(cms_url, get_cms_block_link(self.course, 'course'))