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, unicode(self.course.id)) self.assertEqual(cms_url, get_cms_course_link(self.course)) cms_url = u"//{}/course/{}".format(CMS_BASE_TEST, unicode(self.course.location)) self.assertEqual(cms_url, get_cms_block_link(self.course, "course"))
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/slashes:org+num+name".format(CMS_BASE_TEST) self.assertEqual(cms_url, get_cms_course_link(self.course)) cms_url = u"//{}/course/location:org+num+name+course+name".format(CMS_BASE_TEST) self.assertEqual(cms_url, get_cms_block_link(self.course, 'course'))
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, unicode(self.course.id)) self.assertEqual(cms_url, get_cms_course_link(self.course)) cms_url = u"//{}/course/{}".format(CMS_BASE_TEST, unicode(self.course.location)) self.assertEqual(cms_url, get_cms_block_link(self.course, 'course'))
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 """ cms_url = u"//{}/course/org.num.name/branch/draft/block/name".format(CMS_BASE_TEST) self.course = CourseFactory.create( org='org', number='num', display_name='name' ) self.assertEqual(cms_url, get_cms_course_link(self.course)) self.assertEqual(cms_url, get_cms_block_link(self.course, 'course'))