Commit 420ed091 by Ned Batchelder Committed by GitHub

Merge pull request #14784 from edx/nedbat/patch-ficus-help-tests

Force help link tests to pass on Ficus
parents 541e7e44 fc8d515b
...@@ -37,33 +37,35 @@ class HelpContextProcessorTest(TestCase): ...@@ -37,33 +37,35 @@ class HelpContextProcessorTest(TestCase):
def test_get_doc_url(self): def test_get_doc_url(self):
# Test default values. # Test default values.
self.assertEqual( self.assertEqual(
"http://edx.readthedocs.io/projects/open-edx-learner-guide/en/latest/index.html", "http://edx.readthedocs.io/projects/open-edx-learner-guide/en/open-release-ficus.master/index.html",
HelpContextProcessorTest._get_doc_url() HelpContextProcessorTest._get_doc_url()
) )
# Provide a known page_token. # Provide a known page_token.
self.assertEqual( self.assertEqual(
"http://edx.readthedocs.io/projects/open-edx-learner-guide/en/latest/sfd_dashboard_profile/index.html", "http://edx.readthedocs.io/projects/open-edx-learner-guide/" +
"en/open-release-ficus.master/sfd_dashboard_profile/index.html",
HelpContextProcessorTest._get_doc_url('profile') HelpContextProcessorTest._get_doc_url('profile')
) )
# Use settings.DOC_LINK_BASE_URL to override default base_url. # Use settings.DOC_LINK_BASE_URL to override default base_url.
with patch('django.conf.settings.DOC_LINK_BASE_URL', 'settings_base_url'): with patch('django.conf.settings.DOC_LINK_BASE_URL', 'settings_base_url'):
self.assertEqual( self.assertEqual(
"settings_base_url/en/latest/SFD_instructor_dash_help.html", "settings_base_url/en/open-release-ficus.master/SFD_instructor_dash_help.html",
HelpContextProcessorTest._get_doc_url('instructor') HelpContextProcessorTest._get_doc_url('instructor')
) )
def test_get_pdf_url(self): def test_get_pdf_url(self):
# Test default values. # Test default values.
self.assertEqual( self.assertEqual(
"https://media.readthedocs.org/pdf/open-edx-learner-guide/latest/open-edx-learner-guide.pdf", "https://media.readthedocs.org/pdf/open-edx-learner-guide/" +
"open-release-ficus.master/open-edx-learner-guide.pdf",
HelpContextProcessorTest._get_pdf_url() HelpContextProcessorTest._get_pdf_url()
) )
# Use settings.DOC_LINK_BASE_URL to override default base_url. # Use settings.DOC_LINK_BASE_URL to override default base_url.
with patch('django.conf.settings.DOC_LINK_BASE_URL', 'settings_base_url'): with patch('django.conf.settings.DOC_LINK_BASE_URL', 'settings_base_url'):
self.assertEqual( self.assertEqual(
"settings_base_url/latest/open-edx-learner-guide.pdf", "settings_base_url/open-release-ficus.master/open-edx-learner-guide.pdf",
HelpContextProcessorTest._get_pdf_url() HelpContextProcessorTest._get_pdf_url()
) )
...@@ -66,7 +66,8 @@ class TestCohortHelp(ContainerBase): ...@@ -66,7 +66,8 @@ class TestCohortHelp(ContainerBase):
""" """
self.cohort_management.add_cohort('cohort_name') self.cohort_management.add_cohort('cohort_name')
href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/' \ href = 'http://edx.readthedocs.org/projects/open-edx-building-and-running-a-course/en/' \
'open-release-ficus.master/' \
'course_features/cohorts/cohort_config.html#assign-learners-to-cohorts-manually' 'course_features/cohorts/cohort_config.html#assign-learners-to-cohorts-manually'
self.verify_help_link(href) self.verify_help_link(href)
...@@ -86,7 +87,8 @@ class TestCohortHelp(ContainerBase): ...@@ -86,7 +87,8 @@ class TestCohortHelp(ContainerBase):
self.cohort_management.add_cohort('cohort_name', assignment_type='random') self.cohort_management.add_cohort('cohort_name', assignment_type='random')
href = 'http://edx.readthedocs.org/projects/edx-partner-course-staff/en/latest/' \ href = 'http://edx.readthedocs.org/projects/open-edx-building-and-running-a-course/en/' \
'open-release-ficus.master/' \
'course_features/cohorts/cohorts_overview.html#all-automated-assignment' 'course_features/cohorts/cohorts_overview.html#all-automated-assignment'
self.verify_help_link(href) self.verify_help_link(href)
...@@ -119,6 +121,7 @@ class InstructorDashboardHelp(BaseInstructorDashboardTest): ...@@ -119,6 +121,7 @@ class InstructorDashboardHelp(BaseInstructorDashboardTest):
When I click "Help" When I click "Help"
Then I see help about the instructor dashboard in a new tab 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/open-edx-learner-guide/en/' \
'open-release-ficus.master/SFD_instructor_dash_help.html'
self.instructor_dashboard_page.click_help() self.instructor_dashboard_page.click_help()
assert_opened_help_link_is_correct(self, href) assert_opened_help_link_is_correct(self, href)
...@@ -211,7 +211,7 @@ ECOMMERCE_API_URL = 'http://localhost:8043/api/v2/' ...@@ -211,7 +211,7 @@ ECOMMERCE_API_URL = 'http://localhost:8043/api/v2/'
ECOMMERCE_API_SIGNING_KEY = 'ecommerce-key' ECOMMERCE_API_SIGNING_KEY = 'ecommerce-key'
LMS_ROOT_URL = "http://localhost:8000" LMS_ROOT_URL = "http://localhost:8000"
DOC_LINK_BASE_URL = 'http://edx.readthedocs.io/projects/edx-guide-for-students' DOC_LINK_BASE_URL = 'http://edx.readthedocs.io/projects/open-edx-learner-guide'
##################################################################### #####################################################################
# Lastly, see if the developer has any local overrides. # Lastly, see if the developer has any local overrides.
......
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