Commit 04be309e by cahrens

Cleanup from rebase.

parent 36afbfbd
...@@ -11,7 +11,6 @@ from contentstore.views.course import course_outline_initial_state ...@@ -11,7 +11,6 @@ from contentstore.views.course import course_outline_initial_state
from contentstore.views.item import create_xblock_info, VisibilityState from contentstore.views.item import create_xblock_info, VisibilityState
from course_action_state.models import CourseRerunState from course_action_state.models import CourseRerunState
from contentstore.views.item import create_xblock_info from contentstore.views.item import create_xblock_info
from contentstore.views.item import create_xblock_info, PublishState
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from opaque_keys.edx.locator import CourseLocator from opaque_keys.edx.locator import CourseLocator
...@@ -107,19 +106,19 @@ class TestCourseIndex(CourseTestCase): ...@@ -107,19 +106,19 @@ class TestCourseIndex(CourseTestCase):
self.assertEqual(json_response['category'], 'course') self.assertEqual(json_response['category'], 'course')
self.assertEqual(json_response['id'], 'i4x://MITx/999/course/Robot_Super_Course') self.assertEqual(json_response['id'], 'i4x://MITx/999/course/Robot_Super_Course')
self.assertEqual(json_response['display_name'], 'Robot Super Course') self.assertEqual(json_response['display_name'], 'Robot Super Course')
self.assertTrue(json_response['is_container']) self.assertTrue(json_response['published'])
self.assertFalse(json_response['is_draft']) self.assertIsNone(json_response['visibility_state'])
# Now verify the first child # Now verify the first child
children = json_response['children'] children = json_response['child_info']['children']
self.assertTrue(len(children) > 0) self.assertTrue(len(children) > 0)
first_child_response = children[0] first_child_response = children[0]
self.assertEqual(first_child_response['category'], 'chapter') self.assertEqual(first_child_response['category'], 'chapter')
self.assertEqual(first_child_response['id'], 'i4x://MITx/999/chapter/Week_1') self.assertEqual(first_child_response['id'], 'i4x://MITx/999/chapter/Week_1')
self.assertEqual(first_child_response['display_name'], 'Week 1') self.assertEqual(first_child_response['display_name'], 'Week 1')
self.assertTrue(first_child_response['is_container']) self.assertTrue(json_response['published'])
self.assertFalse(first_child_response['is_draft']) self.assertEqual(first_child_response['visibility_state'], VisibilityState.unscheduled)
self.assertTrue(len(first_child_response['children']) > 0) self.assertTrue(len(first_child_response['child_info']['children']) > 0)
# Finally, validate the entire response for consistency # Finally, validate the entire response for consistency
self.assert_correct_json_response(json_response) self.assert_correct_json_response(json_response)
...@@ -188,13 +187,10 @@ class TestCourseIndex(CourseTestCase): ...@@ -188,13 +187,10 @@ class TestCourseIndex(CourseTestCase):
self.assertIsNotNone(json_response['display_name']) self.assertIsNotNone(json_response['display_name'])
self.assertIsNotNone(json_response['id']) self.assertIsNotNone(json_response['id'])
self.assertIsNotNone(json_response['category']) self.assertIsNotNone(json_response['category'])
self.assertIsNotNone(json_response['is_draft']) self.assertTrue(json_response['published'])
self.assertIsNotNone(json_response['is_container']) if json_response.get('child_info', None):
if json_response['is_container']: for child_response in json_response['child_info']['children']:
for child_response in json_response['children']:
self.assert_correct_json_response(child_response) self.assert_correct_json_response(child_response)
else:
self.assertFalse('children' in json_response)
class TestCourseOutline(CourseTestCase): class TestCourseOutline(CourseTestCase):
......
define([ define([
'js/views/baseview', 'jquery', 'js/views/group_configuration_details', 'js/views/baseview', 'jquery', "gettext", 'js/views/group_configuration_details',
'js/views/group_configuration_edit' 'js/views/group_configuration_edit', "js/views/utils/view_utils"
], function( ], function(
BaseView, $, GroupConfigurationDetails, GroupConfigurationEdit BaseView, $, gettext, GroupConfigurationDetails, GroupConfigurationEdit, ViewUtils
) { ) {
'use strict'; 'use strict';
var GroupConfigurationsItem = BaseView.extend({ var GroupConfigurationsItem = BaseView.extend({
...@@ -35,12 +35,12 @@ define([ ...@@ -35,12 +35,12 @@ define([
deleteConfiguration: function(event) { deleteConfiguration: function(event) {
if(event && event.preventDefault) { event.preventDefault(); } if(event && event.preventDefault) { event.preventDefault(); }
var self = this; var self = this;
this.confirmThenRunOperation( ViewUtils.confirmThenRunOperation(
gettext('Delete this Group Configuration?'), gettext('Delete this Group Configuration?'),
gettext('Deleting this Group Configuration is permanent and cannot be undone.'), gettext('Deleting this Group Configuration is permanent and cannot be undone.'),
gettext('Delete'), gettext('Delete'),
function() { function() {
return self.runOperationShowingMessage( return ViewUtils.runOperationShowingMessage(
gettext('Deleting') + '…', gettext('Deleting') + '…',
function () { function () {
return self.model.destroy({ wait: true }); return self.model.destroy({ wait: true });
......
...@@ -11,7 +11,7 @@ from selenium.webdriver.common.keys import Keys ...@@ -11,7 +11,7 @@ from selenium.webdriver.common.keys import Keys
from .course_page import CoursePage from .course_page import CoursePage
from .container import ContainerPage from .container import ContainerPage
from .utils import set_input_value_and_save, click_css, confirm_prompt, set_input_value from .utils import set_input_value_and_save, click_css, confirm_prompt
class CourseOutlineItem(object): class CourseOutlineItem(object):
...@@ -82,7 +82,7 @@ class CourseOutlineItem(object): ...@@ -82,7 +82,7 @@ class CourseOutlineItem(object):
""" """
Enters new_name as the item's display name. Enters new_name as the item's display name.
""" """
set_input_value(self, self._bounded_selector(self.NAME_INPUT_SELECTOR), new_name) set_input_value_and_save(self, self._bounded_selector(self.NAME_INPUT_SELECTOR), new_name)
def change_name(self, new_name): def change_name(self, new_name):
""" """
......
...@@ -16,7 +16,7 @@ from ..pages.lms.staff_view import StaffPage ...@@ -16,7 +16,7 @@ from ..pages.lms.staff_view import StaffPage
import datetime import datetime
from bok_choy.promise import Promise, EmptyPromise from bok_choy.promise import Promise, EmptyPromise
from acceptance.tests.base_studio_test import StudioCourseTest from .base_studio_test import StudioCourseTest
@attr('shard_1') @attr('shard_1')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment