From bd71a2ceb3a03d283db6e6a255ac409b80419b20 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Fri, 16 Aug 2013 15:24:43 -0400 Subject: [PATCH] add unit test for video_caption asset path --- .../contentstore/tests/test_contentstore.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index e70df4164a..96b0b84e36 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -400,6 +400,20 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): resp = self.client.get(url) self.assertEqual(resp.status_code, 200) + def test_video_module_caption_asset_path(self): + ''' + This verifies that a video caption url is as we expect it to be + ''' + direct_store = modulestore('direct') + import_from_xml(direct_store, 'common/test/data/', ['toy']) + + # also try a custom response which will trigger the 'is this course in whitelist' logic + video_module_location = Location(['i4x', 'edX', 'toy', 'video', 'sample_video', None]) + url = reverse('preview_component', kwargs={'location': video_module_location.url()}) + resp = self.client.get(url) + self.assertEqual(resp.status_code, 200) + self.assertContains(resp, 'data-caption-asset-path="/c4x/edX/toy/asset/subs_"') + def test_delete(self): direct_store = modulestore('direct') CourseFactory.create(org='edX', course='999', display_name='Robot Super Course')