diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 09413be7b7..2ffd5a3684 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -107,8 +107,8 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): expected_types is the list of elements that should appear on the page. expected_types and component_types should be similar, but not - exactly the same -- for example, 'videoalpha' in - component_types should cause 'Video Alpha' to be present. + exactly the same -- for example, 'video' in + component_types should cause 'Video' to be present. """ store = modulestore('direct') import_from_xml(store, 'common/test/data/', ['simple']) @@ -143,7 +143,7 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase): 'Peer Grading Interface']) def test_advanced_components_require_two_clicks(self): - self.check_components_on_page(['videoalpha'], ['Video Alpha']) + self.check_components_on_page(['video'], ['Video']) def test_malformed_edit_unit_request(self): store = modulestore('direct') @@ -1624,7 +1624,7 @@ class MetadataSaveTestCase(ModuleStoreTestCase): constructor are correctly persisted. """ # We should start with a source field, from the XML's tag - self.assertIn('source', own_metadata(self.descriptor)) + self.assertIn('html5_sources', own_metadata(self.descriptor)) attrs_to_strip = { 'show_captions', 'youtube_id_1_0', @@ -1634,6 +1634,7 @@ class MetadataSaveTestCase(ModuleStoreTestCase): 'start_time', 'end_time', 'source', + 'html5_sources', 'track' } # We strip out all metadata fields to reproduce a bug where @@ -1646,11 +1647,11 @@ class MetadataSaveTestCase(ModuleStoreTestCase): field.delete_from(self.descriptor) # Assert that we correctly stripped the field - self.assertNotIn('source', own_metadata(self.descriptor)) + self.assertNotIn('html5_sources', own_metadata(self.descriptor)) get_modulestore(self.descriptor.location).update_metadata( self.descriptor.location, own_metadata(self.descriptor) ) module = get_modulestore(self.descriptor.location).get_item(self.descriptor.location) # Assert that get_item correctly sets the metadata - self.assertIn('source', own_metadata(module)) + self.assertIn('html5_sources', own_metadata(module)) diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 7cb503db1e..d7b41acb24 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -49,7 +49,6 @@ NOTE_COMPONENT_TYPES = ['notes'] ADVANCED_COMPONENT_TYPES = [ 'annotatable', 'word_cloud', - 'videoalpha', 'graphical_slider_tool' ] + OPEN_ENDED_COMPONENT_TYPES + NOTE_COMPONENT_TYPES ADVANCED_COMPONENT_CATEGORY = 'advanced' diff --git a/common/lib/xmodule/setup.py b/common/lib/xmodule/setup.py index 6b106dd94d..704de15ea7 100644 --- a/common/lib/xmodule/setup.py +++ b/common/lib/xmodule/setup.py @@ -40,7 +40,7 @@ setup( "timelimit = xmodule.timelimit_module:TimeLimitDescriptor", "vertical = xmodule.vertical_module:VerticalDescriptor", "video = xmodule.video_module:VideoDescriptor", - "videoalpha = xmodule.videoalpha_module:VideoAlphaDescriptor", + "videoalpha = xmodule.video_module:VideoDescriptor", "videodev = xmodule.backcompat_module:TranslateCustomTagDescriptor", "videosequence = xmodule.seq_module:SequenceDescriptor", "discussion = xmodule.discussion_module:DiscussionDescriptor", diff --git a/common/lib/xmodule/xmodule/tests/test_editing_module.py b/common/lib/xmodule/xmodule/tests/test_editing_module.py index 03e257940f..838a4f9ada 100644 --- a/common/lib/xmodule/xmodule/tests/test_editing_module.py +++ b/common/lib/xmodule/xmodule/tests/test_editing_module.py @@ -33,7 +33,7 @@ class TabsEditingDescriptorTestCase(unittest.TestCase): }, { 'name': "Subtitles", - 'template': "videoalpha/subtitles.html", + 'template': "video/subtitles.html", }, { 'name': "Settings", diff --git a/common/lib/xmodule/xmodule/tests/test_videoalpha.py b/common/lib/xmodule/xmodule/tests/test_video.py similarity index 78% rename from common/lib/xmodule/xmodule/tests/test_videoalpha.py rename to common/lib/xmodule/xmodule/tests/test_video.py index 76f86d6d4a..baafc05d45 100644 --- a/common/lib/xmodule/xmodule/tests/test_videoalpha.py +++ b/common/lib/xmodule/xmodule/tests/test_video.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- #pylint: disable=W0212 -"""Test for Video Alpha Xmodule functional logic. +"""Test for Video Xmodule functional logic. These test data read from xml, not from mongo. We have a ModuleStoreTestCase class defined in @@ -17,37 +17,36 @@ import unittest from . import LogicTest from .import get_test_system from xmodule.modulestore import Location -from xmodule.videoalpha_module import VideoAlphaDescriptor, _create_youtube_string -from xmodule.video_module import VideoDescriptor +from xmodule.video_module import VideoDescriptor, _create_youtube_string from .test_import import DummySystem from textwrap import dedent -class VideoAlphaModuleTest(LogicTest): - """Logic tests for VideoAlpha Xmodule.""" - descriptor_class = VideoAlphaDescriptor +class VideoModuleTest(LogicTest): + """Logic tests for Video Xmodule.""" + descriptor_class = VideoDescriptor raw_model_data = { - 'data': '' + 'data': ' ''' - location = Location(["i4x", "edX", "videoalpha", "default", + location = Location(["i4x", "edX", "video", "default", "SampleProblem1"]) model_data = {'data': sample_xml, 'location': location} system = DummySystem(load_error_modules=True) - descriptor = VideoAlphaDescriptor(system, model_data) + descriptor = VideoDescriptor(system, model_data) self.assert_attributes_equal(descriptor, { 'youtube_id_0_75': 'izygArpw-Qo', 'youtube_id_1_0': 'p2Q6BrNhdh8', @@ -190,16 +189,16 @@ class VideoAlphaDescriptorImportTestCase(unittest.TestCase): def test_from_xml(self): module_system = DummySystem(load_error_modules=True) xml_data = ''' - - + ''' - output = VideoAlphaDescriptor.from_xml(xml_data, module_system) + output = VideoDescriptor.from_xml(xml_data, module_system) self.assert_attributes_equal(output, { 'youtube_id_0_75': 'izygArpw-Qo', 'youtube_id_1_0': 'p2Q6BrNhdh8', @@ -221,14 +220,14 @@ class VideoAlphaDescriptorImportTestCase(unittest.TestCase): """ module_system = DummySystem(load_error_modules=True) xml_data = ''' - - + ''' - output = VideoAlphaDescriptor.from_xml(xml_data, module_system) + output = VideoDescriptor.from_xml(xml_data, module_system) self.assert_attributes_equal(output, { 'youtube_id_0_75': '', 'youtube_id_1_0': 'p2Q6BrNhdh8', @@ -248,8 +247,8 @@ class VideoAlphaDescriptorImportTestCase(unittest.TestCase): Make sure settings are correct if none are explicitly set in XML. """ module_system = DummySystem(load_error_modules=True) - xml_data = '' - output = VideoAlphaDescriptor.from_xml(xml_data, module_system) + xml_data = '' + output = VideoDescriptor.from_xml(xml_data, module_system) self.assert_attributes_equal(output, { 'youtube_id_0_75': '', 'youtube_id_1_0': 'OEoXaMPEzfM', @@ -270,16 +269,16 @@ class VideoAlphaDescriptorImportTestCase(unittest.TestCase): """ module_system = DummySystem(load_error_modules=True) xml_data = """ - - + """ - output = VideoAlphaDescriptor.from_xml(xml_data, module_system) + output = VideoDescriptor.from_xml(xml_data, module_system) self.assert_attributes_equal(output, { 'youtube_id_0_75': 'izygArpw-Qo', 'youtube_id_1_0': 'p2Q6BrNhdh8', @@ -295,7 +294,7 @@ class VideoAlphaDescriptorImportTestCase(unittest.TestCase): def test_old_video_data(self): """ - Ensure that Video Alpha is able to read VideoModule's model data. + Ensure that Video is able to read VideoModule's model data. """ module_system = DummySystem(load_error_modules=True) xml_data = """ @@ -309,8 +308,7 @@ class VideoAlphaDescriptorImportTestCase(unittest.TestCase): """ video = VideoDescriptor.from_xml(xml_data, module_system) - video_alpha = VideoAlphaDescriptor(module_system, video._model_data) - self.assert_attributes_equal(video_alpha, { + self.assert_attributes_equal(video, { 'youtube_id_0_75': 'izygArpw-Qo', 'youtube_id_1_0': 'p2Q6BrNhdh8', 'youtube_id_1_25': '1EeWXzPdhSA', @@ -324,17 +322,17 @@ class VideoAlphaDescriptorImportTestCase(unittest.TestCase): }) -class VideoAlphaExportTestCase(unittest.TestCase): +class VideoExportTestCase(unittest.TestCase): """ - Make sure that VideoAlphaDescriptor can export itself to XML + Make sure that VideoDescriptor can export itself to XML correctly. """ def test_export_to_xml(self): """Test that we write the correct XML on export.""" module_system = DummySystem(load_error_modules=True) - location = Location(["i4x", "edX", "videoalpha", "default", "SampleProblem1"]) - desc = VideoAlphaDescriptor(module_system, {'location': location}) + location = Location(["i4x", "edX", "video", "default", "SampleProblem1"]) + desc = VideoDescriptor(module_system, {'location': location}) desc.youtube_id_0_75 = 'izygArpw-Qo' desc.youtube_id_1_0 = 'p2Q6BrNhdh8' @@ -348,11 +346,11 @@ class VideoAlphaExportTestCase(unittest.TestCase): xml = desc.export_to_xml(None) # We don't use the `resource_fs` parameter expected = dedent('''\ - + + ''') self.assertEquals(expected, xml) @@ -360,10 +358,10 @@ class VideoAlphaExportTestCase(unittest.TestCase): def test_export_to_xml_empty_parameters(self): """Test XML export with defaults.""" module_system = DummySystem(load_error_modules=True) - location = Location(["i4x", "edX", "videoalpha", "default", "SampleProblem1"]) - desc = VideoAlphaDescriptor(module_system, {'location': location}) + location = Location(["i4x", "edX", "video", "default", "SampleProblem1"]) + desc = VideoDescriptor(module_system, {'location': location}) xml = desc.export_to_xml(None) - expected = '\n' + expected = ' """ MODEL_DATA = { 'data': DATA } - def test_videoalpha_constructor(self): + def test_video_constructor(self): """Make sure that if the 'youtube' attribute is omitted in XML, then the template generates an empty string for the YouTube streams. """ diff --git a/lms/djangoapps/courseware/tests/test_videoalpha_xml.py b/lms/djangoapps/courseware/tests/test_video_xml.py similarity index 74% rename from lms/djangoapps/courseware/tests/test_videoalpha_xml.py rename to lms/djangoapps/courseware/tests/test_video_xml.py index e83582e131..64dbe4057b 100644 --- a/lms/djangoapps/courseware/tests/test_videoalpha_xml.py +++ b/lms/djangoapps/courseware/tests/test_video_xml.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # pylint: disable=W0212 -"""Test for VideoAlpha Xmodule functional logic. +"""Test for Video Xmodule functional logic. These test data read from xml, not from mongo. We have a ModuleStoreTestCase class defined in @@ -20,14 +20,14 @@ import unittest from django.conf import settings -from xmodule.videoalpha_module import ( - VideoAlphaDescriptor, _create_youtube_string) +from xmodule.video_module import ( + VideoDescriptor, _create_youtube_string) from xmodule.modulestore import Location from xmodule.tests import get_test_system, LogicTest SOURCE_XML = """ - - + """ -class VideoAlphaFactory(object): - """A helper class to create videoalpha modules with various parameters +class VideoFactory(object): + """A helper class to create video modules with various parameters for testing. """ @@ -50,28 +50,28 @@ class VideoAlphaFactory(object): @staticmethod def create(): - """Method return VideoAlpha Xmodule instance.""" - location = Location(["i4x", "edX", "videoalpha", "default", + """Method return Video Xmodule instance.""" + location = Location(["i4x", "edX", "video", "default", "SampleProblem1"]) - model_data = {'data': VideoAlphaFactory.sample_problem_xml_youtube, + model_data = {'data': VideoFactory.sample_problem_xml_youtube, 'location': location} system = get_test_system() system.render_template = lambda template, context: context - descriptor = VideoAlphaDescriptor(system, model_data) + descriptor = VideoDescriptor(system, model_data) module = descriptor.xmodule(system) return module -class VideoAlphaModuleUnitTest(unittest.TestCase): - """Unit tests for VideoAlpha Xmodule.""" +class VideoModuleUnitTest(unittest.TestCase): + """Unit tests for Video Xmodule.""" - def test_videoalpha_get_html(self): + def test_video_get_html(self): """Make sure that all parameters extracted correclty from xml""" - module = VideoAlphaFactory.create() + module = VideoFactory.create() module.runtime.render_template = lambda template, context: context sources = { @@ -98,18 +98,18 @@ class VideoAlphaModuleUnitTest(unittest.TestCase): self.assertEqual(module.get_html(), expected_context) - def test_videoalpha_instance_state(self): - module = VideoAlphaFactory.create() + def test_video_instance_state(self): + module = VideoFactory.create() self.assertDictEqual( json.loads(module.get_instance_state()), {'position': 0}) -class VideoAlphaModuleLogicTest(LogicTest): - """Tests for logic of VideoAlpha Xmodule.""" +class VideoModuleLogicTest(LogicTest): + """Tests for logic of Video Xmodule.""" - descriptor_class = VideoAlphaDescriptor + descriptor_class = VideoDescriptor raw_model_data = { 'data': '