Commit 88a74f42 by Ned Batchelder Committed by GitHub

Merge pull request #14716 from edx/nedbat/refactor-help-links

An indicator of the Open edX release line, and help tests adapted to same.
parents 4d1d709e 4df63b2b
......@@ -4,9 +4,11 @@ Online Contextual Help.
"""
import ConfigParser
from django.conf import settings
import logging
from django.conf import settings
from openedx.core.release import doc_version
log = logging.getLogger(__name__)
......@@ -76,7 +78,7 @@ def common_doc_url(request, config_file_object): # pylint: disable=unused-argum
return "{url_base}/{language}/{version}/{page_path}".format(
url_base=doc_base_url,
language=get_config_value_with_default("locales", settings.LANGUAGE_CODE),
version=config_file_object.get("help_settings", "version"),
version=doc_version(),
page_path=get_config_value_with_default("pages", page_token),
)
......@@ -102,7 +104,7 @@ def common_doc_url(request, config_file_object): # pylint: disable=unused-argum
# Construct and return the URL for the PDF link.
return "{pdf_base}/{version}/{pdf_file}".format(
pdf_base=pdf_base_url,
version=config_file_object.get("help_settings", "version"),
version=doc_version(),
pdf_file=config_file_object.get("pdf_settings", "pdf_file"),
)
......
......@@ -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()))
......@@ -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):
"""
......@@ -27,16 +28,6 @@ class TestCohortHelp(ContainerBase):
self.instructor_dashboard_page.visit()
self.cohort_management = self.instructor_dashboard_page.select_cohort_management()
def get_url_with_changed_domain(self, url):
"""
Replaces .org with .io in the url
Arguments:
url (str): The url to perform replace operation on.
Returns:
str: The updated url
"""
return url.replace('.org/', '.io/')
def verify_help_link(self, href):
"""
Verifies that help link is correct
......@@ -50,7 +41,7 @@ class TestCohortHelp(ContainerBase):
actual_link = self.cohort_management.get_cohort_help_element_and_click_help()
assert_link(self, expected_link, actual_link)
assert_opened_help_link_is_correct(self, self.get_url_with_changed_domain(href))
assert_opened_help_link_is_correct(self, href)
def test_manual_cohort_help(self):
"""
......@@ -66,8 +57,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.io/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 +79,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.io/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 +114,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)
......@@ -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(
......
......@@ -2,7 +2,6 @@
[help_settings]
# The optional DOC_LINK_BASE_URL configuration property will override url_base
url_base = http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course
version = latest
# below are the pdf settings for the pdf file
......
......@@ -2,7 +2,6 @@
[help_settings]
# The optional DOC_LINK_BASE_URL configuration property will override url_base
url_base = http://edx.readthedocs.io/projects/open-edx-learner-guide
version = latest
# below are the pdf settings for the pdf file
......
......@@ -12,10 +12,10 @@
<div class="setup-value">
<% if (cohort.get('assignment_type') == "manual") { %>
<%- gettext("Learners are added to this cohort only when you provide their email addresses or usernames on this page.") %>
<a href="http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/course_features/cohorts/cohort_config.html#assign-learners-to-cohorts-manually" class="incontext-help action-secondary action-help" target="_blank"><%- gettext("What does this mean?") %></a>
<a href="http://edx.readthedocs.io/projects/edx-partner-course-staff/en/latest/course_features/cohorts/cohort_config.html#assign-learners-to-cohorts-manually" class="incontext-help action-secondary action-help" target="_blank"><%- gettext("What does this mean?") %></a>
<% } else { %>
<%- gettext("Learners are added to this cohort automatically.") %>
<a href="http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/course_features/cohorts/cohorts_overview.html#all-automated-assignment" class="incontext-help action-secondary action-help" target="_blank"><%- gettext("What does this mean?") %></a>
<a href="http://edx.readthedocs.io/projects/edx-partner-course-staff/en/latest/course_features/cohorts/cohorts_overview.html#all-automated-assignment" class="incontext-help action-secondary action-help" target="_blank"><%- gettext("What does this mean?") %></a>
<% } %>
</div>
</div>
"""
Information about the release line of this Open edX code.
"""
# The release line: an Open edX release name ("ficus"), or "master".
# This should always be "master" on the master branch, and will be changed
# manually when we start release-line branches, like open-release/ficus.master.
RELEASE_LINE = "master"
def doc_version():
"""The readthedocs.org version name used in documentation references.
Returns a short string like "latest" or "open-release-ficus.master".
"""
if RELEASE_LINE == "master":
return "latest"
else:
return "open-release-{}.master".format(RELEASE_LINE)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment