Correctly compute course image location when using mongo modulestore
[LMS-2073] [STUD-1197]
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user