Correctly compute course image location when using mongo modulestore

[LMS-2073]
[STUD-1197]
This commit is contained in:
Calen Pennington
2014-01-21 14:12:10 -05:00
parent 923c2ff46e
commit a6035698d5
4 changed files with 2 additions and 6 deletions

View File

@@ -2,7 +2,6 @@
import collections
import copy
import mock
from unittest import expectedFailure
from django.test import TestCase
from django.test.utils import override_settings
@@ -168,7 +167,6 @@ class CourseImageTestCase(TestCase):
url = utils.course_image_url(course)
self.assertEquals(url, '/c4x/edX/999/asset/{0}'.format(course.course_image))
@expectedFailure
def test_non_ascii_image_name(self):
# Verify that non-ascii image names are cleaned
course = CourseFactory.create(course_image=u'before_\N{SNOWMAN}_after.jpg')

View File

@@ -191,7 +191,7 @@ def get_lms_link_for_about_page(location):
def course_image_url(course):
"""Returns the image url for the course."""
loc = course.location._replace(tag='c4x', category='asset', name=course.course_image)
loc = StaticContent.compute_location(course.location.org, course.location.course, course.course_image)
path = StaticContent.get_url_path_from_location(loc)
return path