From bdf2c2864169bc9454b98e2e4b726a7e65a890c1 Mon Sep 17 00:00:00 2001 From: zubair-arbi Date: Fri, 19 Sep 2014 16:37:12 +0500 Subject: [PATCH] update video module to always set download_video field on export --- .../lib/xmodule/xmodule/tests/test_video.py | 41 ++----------------- .../xmodule/video_module/video_module.py | 8 ++++ .../commands/tests/test_dump_course.py | 2 +- .../courseware/tests/test_video_mongo.py | 4 +- 4 files changed, 15 insertions(+), 40 deletions(-) diff --git a/common/lib/xmodule/xmodule/tests/test_video.py b/common/lib/xmodule/xmodule/tests/test_video.py index 0af8212c7f..8763c15225 100644 --- a/common/lib/xmodule/xmodule/tests/test_video.py +++ b/common/lib/xmodule/xmodule/tests/test_video.py @@ -202,40 +202,6 @@ class VideoDescriptorImportTestCase(unittest.TestCase): 'transcripts': {'ua': 'ukrainian_translation.srt', 'ge': 'german_translation.srt'} }) - def test_constructor_for_download_video(self): - """ - Test that "download_video" field is False (default value) if not explicitly set in xml - """ - sample_xml = ''' - - ''' - descriptor = instantiate_descriptor(data=sample_xml) - self.assert_attributes_equal(descriptor, { - 'youtube_id_1_0': 'p2Q6BrNhdh8', - 'download_video': False, - 'html5_sources': ['http://www.example.com/source.mp4'], - 'data': '' - }) - - # Now construct video from xml with explicitly set download_video and check that - # resulting video descriptor has same value for "download_video" - sample_xml = ''' - - ''' - descriptor = instantiate_descriptor(data=sample_xml) - self.assert_attributes_equal(descriptor, { - 'youtube_id_1_0': 'p2Q6BrNhdh8', - 'download_video': True, - 'html5_sources': ['http://www.example.com/source.mp4'], - 'data': '' - }) - def test_from_xml(self): module_system = DummySystem(load_error_modules=True) xml_data = ''' @@ -296,7 +262,7 @@ class VideoDescriptorImportTestCase(unittest.TestCase): 'track': '', 'handout': None, 'download_track': False, - 'download_video': False, + 'download_video': True, 'html5_sources': ['http://www.example.com/source.mp4'], 'data': '' }) @@ -326,7 +292,7 @@ class VideoDescriptorImportTestCase(unittest.TestCase): 'end_time': datetime.timedelta(seconds=0.0), 'track': 'http://www.example.com/track', 'download_track': True, - 'download_video': False, + 'download_video': True, 'html5_sources': ['http://www.example.com/source.mp4'], 'data': '', 'transcripts': {}, @@ -583,7 +549,8 @@ class VideoExportTestCase(VideoDescriptorTestBase): Test XML export with defaults. """ xml = self.descriptor.definition_to_xml(None) - expected = '