From 56015e4b9479d37c07c96321a92ffc545dcc28ff Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Mon, 17 Jun 2013 16:47:15 -0400 Subject: [PATCH] Update CHANGELOG.rst; move acceptance test methods into more appropriate files; docstring cleaning. --- CHANGELOG.rst | 3 +++ cms/djangoapps/contentstore/features/common.py | 10 ++++++++++ .../contentstore/features/video-editor.py | 7 +++++++ cms/djangoapps/contentstore/features/video.py | 17 ----------------- .../xmodule/xmodule/tests/test_video_module.py | 12 ++++++------ 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bbbb023527..ce9c08221e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,9 @@ These are notable changes in edx-platform. This is a rolling list of changes, in roughly chronological order, most recent first. Add your entries at or near the top. Include a label indicating the component affected. +Studio: Remove XML from the video component editor. All settings are +moved to be edited as metadata. + Studio, LMS: Make ModelTypes more strict about their expected content (for instance, Boolean, Integer, String), but also allow them to hold either the typed value, or a String that can be converted to their typed value. For example, diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index 494192ad06..fec1b90040 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -169,3 +169,13 @@ def open_new_unit(step): step.given('I have added a new subsection') step.given('I expand the first section') world.css_click('a.new-unit-item') + + +@step('when I view the video it (.*) show the captions') +def shows_captions(step, show_captions): + # Prevent cookies from overriding course settings + world.browser.cookies.delete('hide_captions') + if show_captions == 'does not': + assert world.css_find('.video')[0].has_class('closed') + else: + assert world.is_css_not_present('.video.closed') diff --git a/cms/djangoapps/contentstore/features/video-editor.py b/cms/djangoapps/contentstore/features/video-editor.py index d82faf5ce4..987b4959b8 100644 --- a/cms/djangoapps/contentstore/features/video-editor.py +++ b/cms/djangoapps/contentstore/features/video-editor.py @@ -14,3 +14,10 @@ def i_see_the_correct_settings_and_values(step): ['Speed: .75x', '', False], ['Speed: 1.25x', '', False], ['Speed: 1.5x', '', False]]) + + +@step('I have set "show captions" to (.*)') +def set_show_captions(step, setting): + world.css_click('a.edit-button') + world.browser.select('Show Captions', setting) + world.css_click('a.save-button') diff --git a/cms/djangoapps/contentstore/features/video.py b/cms/djangoapps/contentstore/features/video.py index 03b63d4137..3a83ad269c 100644 --- a/cms/djangoapps/contentstore/features/video.py +++ b/cms/djangoapps/contentstore/features/video.py @@ -31,20 +31,3 @@ def hide_or_show_captions(step, shown): button = world.css_find(button_css) button.mouse_out() world.css_click(button_css) - - -@step('when I view the video it (.*) show the captions') -def shows_captions(step, show_captions): - # Prevent cookies from overriding course settings - world.browser.cookies.delete('hide_captions') - if show_captions == 'does not': - assert world.css_find('.video')[0].has_class('closed') - else: - assert world.is_css_not_present('.video.closed') - - -@step('I have set "show captions" to (.*)') -def set_show_captions(step, setting): - world.css_click('a.edit-button') - world.browser.select('Show Captions', setting) - world.css_click('a.save-button') diff --git a/common/lib/xmodule/xmodule/tests/test_video_module.py b/common/lib/xmodule/xmodule/tests/test_video_module.py index f8ae54eee1..f516e1a179 100644 --- a/common/lib/xmodule/xmodule/tests/test_video_module.py +++ b/common/lib/xmodule/xmodule/tests/test_video_module.py @@ -6,9 +6,9 @@ from .test_import import DummySystem class VideoDescriptorImportTestCase(unittest.TestCase): - ''' + """ Make sure that VideoDescriptor can import an old XML-based video correctly. - ''' + """ def test_from_xml(self): module_system = DummySystem(load_error_modules=True) @@ -34,10 +34,10 @@ class VideoDescriptorImportTestCase(unittest.TestCase): self.assertEquals(output.source, 'http://www.example.com/source.mp4') def test_from_xml_missing_attributes(self): - ''' + """ Ensure that attributes have the right values if they aren't explicitly set in XML. - ''' + """ module_system = DummySystem(load_error_modules=True) xml_data = '''