Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f7b08b16
Commit
f7b08b16
authored
Mar 17, 2017
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt the tests to openedx.core.release.doc_version()
parent
60221dcc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
26 deletions
+24
-26
common/djangoapps/util/tests/test_help_context_processor.py
+11
-20
common/test/acceptance/tests/lms/test_lms_help.py
+13
-6
common/test/acceptance/tests/studio/test_studio_help.py
+0
-0
No files found.
common/djangoapps/util/tests/test_help_context_processor.py
View file @
f7b08b16
...
...
@@ -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
()))
common/test/acceptance/tests/lms/test_lms_help.py
View file @
f7b08b16
...
...
@@ -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
)
common/test/acceptance/tests/studio/test_studio_help.py
View file @
f7b08b16
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment