From 861f1ef7bb207e9a4cdd3a855f97c4f09d7ef933 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Wed, 31 Jul 2013 18:12:11 -0400 Subject: [PATCH] add a test for the static url generation --- cms/djangoapps/contentstore/tests/test_assets.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cms/djangoapps/contentstore/tests/test_assets.py b/cms/djangoapps/contentstore/tests/test_assets.py index cde40d502e..b627237729 100644 --- a/cms/djangoapps/contentstore/tests/test_assets.py +++ b/cms/djangoapps/contentstore/tests/test_assets.py @@ -10,6 +10,8 @@ from unittest import TestCase, skip from .utils import CourseTestCase from django.core.urlresolvers import reverse from contentstore.views import assets +from xmodule.contentstore.content import StaticContent +from xmodule.modulestore import Location class AssetsTestCase(CourseTestCase): @@ -35,6 +37,11 @@ class AssetsTestCase(CourseTestCase): content = json.loads(resp.content) self.assertIsInstance(content, list) + def test_static_url_generation(self): + location = Location(['i4x', 'foo', 'bar', 'asset', 'my_file_name.jpg']) + path = StaticContent.get_static_path_from_location(location) + self.assertEquals(path, '/static/my_file_name.jpg') + class UploadTestCase(CourseTestCase): """