diff --git a/common/djangoapps/util/tests/test_help_context_processor.py b/common/djangoapps/util/tests/test_help_context_processor.py index 3b388f3421..b4c2e26a5a 100644 --- a/common/djangoapps/util/tests/test_help_context_processor.py +++ b/common/djangoapps/util/tests/test_help_context_processor.py @@ -8,6 +8,7 @@ from mock import patch from django.conf import settings from django.test import TestCase +from openedx.core.release import doc_version from util.help_context_processor import common_doc_url @@ -33,34 +34,24 @@ class HelpContextProcessorTest(TestCase): def test_get_doc_url(self): # Test default values. - self.assertRegexpMatches( - self._get_doc_url(), - "http://edx.readthedocs.io/projects/open-edx-learner-guide/en/.*/index.html" - ) + doc = "http://edx.readthedocs.io/projects/open-edx-learner-guide/en/{}/index.html" + self.assertEqual(self._get_doc_url(), doc.format(doc_version())) # Provide a known page_token. - self.assertRegexpMatches( - self._get_doc_url('profile'), - "http://edx.readthedocs.io/projects/open-edx-learner-guide/en/.*/sfd_dashboard_profile/index.html" - ) + doc = "http://edx.readthedocs.io/projects/open-edx-learner-guide/en/{}/sfd_dashboard_profile/index.html" + self.assertEqual(self._get_doc_url('profile'), doc.format(doc_version())) # Use settings.DOC_LINK_BASE_URL to override default base_url. + doc = "settings_base_url/en/{}/SFD_instructor_dash_help.html" with patch('django.conf.settings.DOC_LINK_BASE_URL', 'settings_base_url'): - self.assertRegexpMatches( - self._get_doc_url('instructor'), - "settings_base_url/en/.*/SFD_instructor_dash_help.html" - ) + self.assertEqual(self._get_doc_url('instructor'), doc.format(doc_version())) def test_get_pdf_url(self): # Test default values. - self.assertRegexpMatches( - self._get_pdf_url(), - "https://media.readthedocs.org/pdf/open-edx-learner-guide/.*/open-edx-learner-guide.pdf" - ) + doc = "https://media.readthedocs.org/pdf/open-edx-learner-guide/{}/open-edx-learner-guide.pdf" + self.assertEqual(self._get_pdf_url(), doc.format(doc_version())) # Use settings.DOC_LINK_BASE_URL to override default base_url. + doc = "settings_base_url/{}/open-edx-learner-guide.pdf" with patch('django.conf.settings.DOC_LINK_BASE_URL', 'settings_base_url'): - self.assertRegexpMatches( - self._get_pdf_url(), - "settings_base_url/.*/open-edx-learner-guide.pdf" - ) + self.assertEqual(self._get_pdf_url(), doc.format(doc_version())) diff --git a/common/test/acceptance/tests/lms/test_lms_help.py b/common/test/acceptance/tests/lms/test_lms_help.py index d8d442055b..13b84a12aa 100644 --- a/common/test/acceptance/tests/lms/test_lms_help.py +++ b/common/test/acceptance/tests/lms/test_lms_help.py @@ -3,7 +3,6 @@ Test Help links in LMS """ import json - from common.test.acceptance.tests.lms.test_lms_instructor_dashboard import BaseInstructorDashboardTest from common.test.acceptance.pages.lms.instructor_dashboard import InstructorDashboardPage from common.test.acceptance.tests.studio.base_studio_test import ContainerBase @@ -15,6 +14,8 @@ from common.test.acceptance.tests.helpers import ( assert_opened_help_link_is_correct ) +from openedx.core.release import doc_version + class TestCohortHelp(ContainerBase): """ @@ -66,8 +67,10 @@ class TestCohortHelp(ContainerBase): """ self.cohort_management.add_cohort('cohort_name') - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/' \ - 'course_features/cohorts/cohort_config.html#assign-learners-to-cohorts-manually' + href = ( + 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/{}/' + 'course_features/cohorts/cohort_config.html#assign-learners-to-cohorts-manually' + ).format(doc_version()) self.verify_help_link(href) @@ -86,8 +89,10 @@ class TestCohortHelp(ContainerBase): self.cohort_management.add_cohort('cohort_name', assignment_type='random') - href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/' \ - 'course_features/cohorts/cohorts_overview.html#all-automated-assignment' + href = ( + 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/{}/' + 'course_features/cohorts/cohorts_overview.html#all-automated-assignment' + ).format(doc_version()) self.verify_help_link(href) @@ -119,6 +124,8 @@ class InstructorDashboardHelp(BaseInstructorDashboardTest): When I click "Help" Then I see help about the instructor dashboard in a new tab """ - href = 'http://edx.readthedocs.io/projects/edx-guide-for-students/en/latest/SFD_instructor_dash_help.html' + href = ( + 'http://edx.readthedocs.io/projects/edx-guide-for-students/en/{}/SFD_instructor_dash_help.html' + ).format(doc_version()) self.instructor_dashboard_page.click_help() assert_opened_help_link_is_correct(self, href) diff --git a/common/test/acceptance/tests/studio/test_studio_help.py b/common/test/acceptance/tests/studio/test_studio_help.py index de5bd60583..1e7055480c 100644 --- a/common/test/acceptance/tests/studio/test_studio_help.py +++ b/common/test/acceptance/tests/studio/test_studio_help.py @@ -34,6 +34,8 @@ from common.test.acceptance.tests.helpers import ( from common.test.acceptance.pages.studio.import_export import ExportLibraryPage, ImportLibraryPage from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage +from openedx.core.release import doc_version + @attr(shard=10) class StudioHelpTest(StudioCourseTest): @@ -96,8 +98,10 @@ class SignInHelpTest(AcceptanceTest): """ sign_in_page = self.index_page.click_sign_in() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -129,8 +133,10 @@ class SignUpHelpTest(AcceptanceTest): """ sign_up_page = self.index_page.click_sign_up() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -161,8 +167,10 @@ class HomeHelpTest(StudioCourseTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -181,8 +189,10 @@ class HomeHelpTest(StudioCourseTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -218,8 +228,10 @@ class NewCourseHelpTest(AcceptanceTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -238,8 +250,10 @@ class NewCourseHelpTest(AcceptanceTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -275,8 +289,10 @@ class NewLibraryHelpTest(AcceptanceTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -295,8 +311,10 @@ class NewLibraryHelpTest(AcceptanceTest): And help url should end with 'getting_started/get_started.html' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -332,8 +350,10 @@ class LibraryTabHelpTest(AcceptanceTest): self.assertTrue(self.dashboard_page.has_new_library_button) click_css(self.dashboard_page, '#course-index-tabs .libraries-tab', 0, False) # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -365,8 +385,10 @@ class LibraryHelpTest(StudioLibraryTest): """ self.library_page.visit() # The href we want to see in anchor help element. - href = "http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/" \ - "en/latest/course_components/libraries.html" + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_components/libraries.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -387,8 +409,10 @@ class LibraryHelpTest(StudioLibraryTest): """ self.library_page.visit() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/course_components/libraries.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_components/libraries.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -411,8 +435,10 @@ class LibraryHelpTest(StudioLibraryTest): """ self.library_user_page.visit() # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/course_components/libraries.html#give-other-users-access-to-your-library' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_components/libraries.html#give-other-users-access-to-your-library' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -442,8 +468,10 @@ class LibraryImportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#import-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/course_components/libraries.html#import-a-library' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/course_components/libraries.html#import-a-library' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -462,8 +490,10 @@ class LibraryImportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#import-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/course_components/libraries.html#import-a-library' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/course_components/libraries.html#import-a-library' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -494,8 +524,10 @@ class LibraryExportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#export-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/course_components/libraries.html#export-a-library' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/course_components/libraries.html#export-a-library' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -514,8 +546,10 @@ class LibraryExportHelpTest(StudioLibraryTest): And help url should end with 'creating_content/libraries.html#export-a-library' """ # The href we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/course_components/libraries.html#export-a-library' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/course_components/libraries.html#export-a-library' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -551,8 +585,10 @@ class CourseOutlineHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'developing_course/course_outline.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/developing_course/course_outline.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/developing_course/course_outline.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -570,8 +606,10 @@ class CourseOutlineHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'developing_course/course_outline.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/developing_course/course_outline.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/developing_course/course_outline.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -607,8 +645,10 @@ class CourseUpdateHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/handouts_updates.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/course_assets/handouts_updates.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_assets/handouts_updates.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -642,8 +682,10 @@ class AssetIndexHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/course_files.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/course_assets/course_files.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_assets/course_files.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -661,8 +703,10 @@ class AssetIndexHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/course_files.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/course_assets/course_files.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_assets/course_files.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -697,8 +741,10 @@ class CoursePagesHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/pages.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/course_assets/pages.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_assets/pages.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -732,8 +778,10 @@ class UploadTextbookHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/textbooks.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/course_assets/textbooks.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/course_assets/textbooks.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -751,8 +799,10 @@ class UploadTextbookHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_assets/textbooks.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/course_assets/textbooks.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/course_assets/textbooks.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -802,8 +852,10 @@ class StudioUnitHelpTest(ContainerBase): And help url should end with 'developing_course/course_units.html' """ unit_page = self.go_to_unit_page() - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/developing_course/course_units.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/developing_course/course_units.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -839,8 +891,10 @@ class SettingsHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/setting_up_student_view.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/set_up_course/setting_up_student_view.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/set_up_course/setting_up_student_view.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -876,8 +930,10 @@ class GradingPageHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'grading/index.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/grading/index.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/grading/index.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -913,8 +969,10 @@ class CourseTeamSettingsHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/course_staffing.html#add-course-team-members' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/set_up_course/course_staffing.html#add-course-team-members' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/set_up_course/course_staffing.html#add-course-team-members' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -951,8 +1009,10 @@ class CourseGroupConfigurationHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'index.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/index.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/index.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -971,8 +1031,10 @@ class CourseGroupConfigurationHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'course_features/cohorts/cohorted_courseware.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/course_features/cohorts/cohorted_courseware.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/course_features/cohorts/cohorted_courseware.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -1009,8 +1071,10 @@ class AdvancedSettingHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'index.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/index.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/index.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -1046,8 +1110,10 @@ class CertificatePageHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/creating_course_certificates.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/set_up_course/creating_course_certificates.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/set_up_course/creating_course_certificates.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -1065,8 +1131,10 @@ class CertificatePageHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'set_up_course/creating_course_certificates.html' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' \ - '/en/latest/set_up_course/creating_course_certificates.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course' + '/en/{}/set_up_course/creating_course_certificates.html' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -1117,8 +1185,11 @@ class GroupExperimentConfigurationHelpTest(ContainerBase): And help url should end with 'content_experiments_configure.html#set-up-group-configurations-in-edx-studio' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/latest/course_features' \ - '/content_experiments/content_experiments_configure.html#set-up-group-configurations-in-edx-studio' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/{}/course_features' + '/content_experiments/content_experiments_configure.html#set-up-group-configurations-in-edx-studio' + ).format(doc_version()) + # Assert that help link is correct. assert_side_bar_help_link( test=self, @@ -1154,8 +1225,10 @@ class ToolsImportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#import-a-course' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/releasing_course/export_import_course.html#import-a-course' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/releasing_course/export_import_course.html#import-a-course' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -1173,8 +1246,10 @@ class ToolsImportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#import-a-course' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/releasing_course/export_import_course.html#import-a-course' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/releasing_course/export_import_course.html#import-a-course' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -1211,8 +1286,10 @@ class ToolsExportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#export-a-course' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/releasing_course/export_import_course.html#export-a-course' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/releasing_course/export_import_course.html#export-a-course' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link( @@ -1230,8 +1307,10 @@ class ToolsExportHelpTest(StudioCourseTest): Then Help link should open. And help url should end with 'releasing_course/export_import_course.html#export-a-course' """ - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \ - 'latest/releasing_course/export_import_course.html#export-a-course' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' + '{}/releasing_course/export_import_course.html#export-a-course' + ).format(doc_version()) # Assert that help link is correct. assert_side_bar_help_link( @@ -1262,8 +1341,10 @@ class StudioWelcomeHelpTest(AcceptanceTest): And help url should contain 'getting_started/get_started.html' """ # The url we want to see in anchor help element. - href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' \ - 'en/latest/getting_started/get_started.html' + href = ( + 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/' + 'en/{}/getting_started/get_started.html' + ).format(doc_version()) # Assert that help link is correct. assert_nav_help_link(