More test fixes

Fix opaque key TODOs left over from split-migrator changes and fixed test_image_import to use the correct course

Reset get_location_from_path to pre deprecated opaque-keys

Fix CMS acceptance test

Fixed usage key reassignment in item.py
This commit is contained in:
Mat Peterson
2014-07-10 19:49:27 +00:00
committed by Diana Huang
parent 98649072bd
commit cd82abae6c
5 changed files with 13 additions and 14 deletions

View File

@@ -54,6 +54,10 @@ def i_click_on_error_dialog(step):
course_key = SlashSeparatedCourseKey("MITx", "999", "Robot_Super_Course")
# we don't know the actual ID of the vertical. So just check that we did go to a
# vertical page in the course (there should only be one).
vertical_usage_key = course_key.make_usage_key("vertical", "")
vertical_usage_key = course_key.make_usage_key("vertical", None)
vertical_url = reverse_usage_url('unit_handler', vertical_usage_key)
# Remove the trailing "/None" from the URL - we don't know the course ID, so we just want to
# check that we visited a vertical URL.
if vertical_url.endswith("/None"):
vertical_url = vertical_url[:-5]
assert_equal(1, world.browser.url.count(vertical_url))

View File

@@ -1479,7 +1479,7 @@ class ContentStoreTest(ContentStoreTestCase):
content_store = contentstore()
# Use conditional_and_poll, as it's got an image already
import_from_xml(
__, courses = import_from_xml(
self.store,
self.user.id,
'common/test/data/',
@@ -1487,7 +1487,7 @@ class ContentStoreTest(ContentStoreTestCase):
static_content_store=content_store
)
course = self.store.get_courses()[0]
course = courses[0]
# Make sure the course image is set to the right place
self.assertEqual(course.course_image, 'images_course_image.jpg')

View File

@@ -318,11 +318,11 @@ def _save_item(user, usage_key, data=None, children=None, metadata=None, nullout
data = old_content['data'] if 'data' in old_content else None
if children is not None:
children_usage_keys = [
UsageKey.from_string(child)
for child
in children
]
children_usage_keys = []
for child in children:
child_usage_key = UsageKey.from_string(child)
child_usage_key = child_usage_key.replace(course_key=modulestore().fill_in_run(child_usage_key.course_key))
children_usage_keys.append(child_usage_key)
existing_item.children = children_usage_keys
# also commit any metadata which might have been passed along