From a3e26e682436fbcc37fd751f8c3b078d8da66a79 Mon Sep 17 00:00:00 2001 From: Andy Armstrong Date: Wed, 9 Apr 2014 12:15:38 -0400 Subject: [PATCH] Implement next round of code reviews --- .../contentstore/views/component.py | 1 - .../views/tests/test_container.py | 31 +- .../js/spec/views/pages/container_spec.js | 29 +- .../js/spec/views/xblock_editor_spec.js | 12 +- cms/static/js/spec/views/xblock_spec.js | 2 +- cms/static/js/spec_helpers/edit_helpers.js | 16 - cms/static/js/views/course_info_handout.js | 4 +- cms/static/js/views/course_info_update.js | 4 +- cms/static/js/views/list_textbooks.js | 4 +- cms/static/js/views/modals/edit_xblock.js | 12 +- cms/static/js/views/paging_footer.js | 2 +- cms/static/js/views/paging_header.js | 2 +- cms/static/sass/elements/_modal-window.scss | 2 +- .../js/mock/mock-container-xblock.underscore | 383 +++++------------- cms/templates/unit.html | 4 +- 15 files changed, 168 insertions(+), 340 deletions(-) diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 8203952009..425b330353 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -273,7 +273,6 @@ def unit_handler(request, tag=None, package_id=None, branch=None, version_guid=N 'context_course': course, 'unit': item, 'unit_locator': locator, - 'xblocks': xblocks, 'locators': locators, 'component_templates': component_templates, 'draft_preview_link': preview_lms_link, diff --git a/cms/djangoapps/contentstore/views/tests/test_container.py b/cms/djangoapps/contentstore/views/tests/test_container.py index fefc19ea21..3c19efc896 100644 --- a/cms/djangoapps/contentstore/views/tests/test_container.py +++ b/cms/djangoapps/contentstore/views/tests/test_container.py @@ -5,6 +5,7 @@ Unit tests for the container view. from contentstore.tests.utils import CourseTestCase from contentstore.utils import compute_publish_state, PublishState from contentstore.views.helpers import xblock_studio_url +from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.factories import ItemFactory @@ -47,13 +48,33 @@ class ContainerViewTestCase(CourseTestCase): Create the scenario of an xblock with children (non-vertical) on the container page. This should create a container page that is a child of another container page. """ - xblock_with_child = ItemFactory.create(parent_location=self.child_vertical.location, - category="wrapper", display_name="Wrapper") - ItemFactory.create(parent_location=xblock_with_child.location, - category="html", display_name="Child HTML") + published_xblock_with_child = ItemFactory.create( + parent_location=self.child_vertical.location, + category="wrapper", display_name="Wrapper" + ) + ItemFactory.create( + parent_location=published_xblock_with_child.location, + category="html", display_name="Child HTML" + ) + draft_xblock_with_child = modulestore('draft').convert_to_draft(published_xblock_with_child.location) branch_name = "MITx.999.Robot_Super_Course/branch/draft/block" self._test_html_content( - xblock_with_child, + published_xblock_with_child, + branch_name=branch_name, + expected_section_tag=( + ' - - - - - - + + - \ No newline at end of file diff --git a/cms/templates/unit.html b/cms/templates/unit.html index 4602b28e73..bc92ffced4 100644 --- a/cms/templates/unit.html +++ b/cms/templates/unit.html @@ -60,8 +60,8 @@ require(["domReady!", "jquery", "js/models/module_info", "coffee/src/views/unit"

    - % for (locator, xblock) in zip(locators, xblocks): -
  1. + % for locator in locators: +
  2. % endfor