Commit 6d20292a by Chris Dodge

add unit test to make sure rewriting is occuring when querying the handouts

parent 7a4d89b1
...@@ -7,6 +7,7 @@ from django.conf import settings ...@@ -7,6 +7,7 @@ from django.conf import settings
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from path import path from path import path
from tempfile import mkdtemp from tempfile import mkdtemp
import json
from student.models import Registration from student.models import Registration
from django.contrib.auth.models import User from django.contrib.auth.models import User
...@@ -417,6 +418,29 @@ class ContentStoreTest(TestCase): ...@@ -417,6 +418,29 @@ class ContentStoreTest(TestCase):
shutil.rmtree(root_dir) shutil.rmtree(root_dir)
def test_course_handouts_rewrites(self):
ms = modulestore('direct')
cs = contentstore()
import_from_xml(ms, 'common/test/data/', ['full'])
handout_location= Location(['i4x', 'edX', 'full', 'course_info', 'handouts'])
resp = self.client.get(reverse('module_info', kwargs={'module_location': handout_location}))
self.assertEqual(resp.status_code, 200)
# check that /static/ has been converted to the full path
self.assertContains(resp, '/c4x/edX/full/asset/handouts_schematic_tutorial.pdf')
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