diff --git a/common/test/data/toy/course/2012_Fall.xml b/common/test/data/toy/course/2012_Fall.xml
index 4bd311c328..679f7bbfdb 100644
--- a/common/test/data/toy/course/2012_Fall.xml
+++ b/common/test/data/toy/course/2012_Fall.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/common/test/data/toy/html/secret/toyjumpto.html b/common/test/data/toy/html/toyjumpto.html
similarity index 100%
rename from common/test/data/toy/html/secret/toyjumpto.html
rename to common/test/data/toy/html/toyjumpto.html
diff --git a/common/test/data/toy/html/secret/toyjumpto.xml b/common/test/data/toy/html/toyjumpto.xml
similarity index 100%
rename from common/test/data/toy/html/secret/toyjumpto.xml
rename to common/test/data/toy/html/toyjumpto.xml
diff --git a/lms/djangoapps/courseware/tests/test_module_render.py b/lms/djangoapps/courseware/tests/test_module_render.py
index 6afb06d9b4..b4b1bcdfd1 100644
--- a/lms/djangoapps/courseware/tests/test_module_render.py
+++ b/lms/djangoapps/courseware/tests/test_module_render.py
@@ -17,6 +17,8 @@ from courseware.tests.tests import LoginEnrollmentTestCase
from courseware.model_data import ModelDataCache
from modulestore_config import TEST_DATA_XML_MODULESTORE
+from courseware.courses import get_course_with_access
+
from .factories import UserFactory
@@ -50,6 +52,30 @@ class ModuleRenderTestCase(LoginEnrollmentTestCase):
self.assertIsNone(render.get_module('dummyuser', None,
'invalid location', None, None))
+ def test_module_render_with_jump_to_id(self):
+ """
+ This test validates that the /jump_to_id/ shorthand for intracourse linking works assertIn
+ expected. Note there's a HTML element in the 'toy' course with the url_name 'toyjumpto' which
+ defines this linkage
+ """
+ mock_request = MagicMock()
+ mock_request.user = self.mock_user
+
+ course = get_course_with_access(self.mock_user, self.course_id, 'load')
+
+ model_data_cache = ModelDataCache.cache_for_descriptor_descendents(
+ self.course_id, self.mock_user, course, depth=2)
+
+ module = render.get_module(self.mock_user, mock_request, ['i4x', 'edX', 'toy', 'html', 'toyjumpto'],
+ model_data_cache, self.course_id)
+
+ # get the rendered HTML output which should have the rewritten link
+ html = module.get_html()
+
+ # See if the url got rewritten to the target link
+ # note if the URL mapping changes then this assertion will break
+ self.assertIn('/courses/'+self.course_id+'/jump_to_id/vertical_test', html)
+
def test_modx_dispatch(self):
self.assertRaises(Http404, render.modx_dispatch, 'dummy', 'dummy',
'invalid Location', 'dummy')