Updates from code review. Includes backing out the

"as_published" changes I previously put in, as now we
are not adding @draft to locations converted from locators.
This commit is contained in:
cahrens
2013-11-25 13:54:45 -05:00
parent 50128cfb5c
commit b5d72a38d3
4 changed files with 16 additions and 22 deletions

View File

@@ -1352,8 +1352,6 @@ class ContentStoreToyCourseTest(ModuleStoreTestCase):
self.assertGreater(len(items), 0)
for descriptor in items:
unit_locator = loc_mapper().translate_location(course_id, descriptor.location, False, True)
print "Checking {0}....".format(unicode(unit_locator))
print descriptor.__class__, descriptor.location
resp = self.client.get_html(unit_locator.url_reverse('unit'))
self.assertEqual(resp.status_code, 200)
# TODO: uncomment when video transcripts no longer require IDs.
@@ -2035,8 +2033,5 @@ def _test_no_locations(test, resp, status_code=200, html=True):
# it checks that the HTML properly parses. However, it won't find i4x usages
# in JavaScript blocks.
content = resp.content
num_jump_to_preview = len(re.findall(r"/preview/(\S)*jump_to/i4x", content))
num_jump_to_live = len(re.findall(r":8000/(\S)*jump_to/i4x", content))
hits = len(re.findall(r"i4x", content)) - num_jump_to_preview - num_jump_to_live
hits = len(re.findall(r"(?<!jump_to/)i4x://", content))
test.assertEqual(hits, 0, "i4x found outside of LMS jump-to links")

View File

@@ -81,7 +81,7 @@ def subsection_handler(request, tag=None, course_id=None, branch=None, version_g
if len(parent_locs) != 1:
logging.error(
'Multiple (or none) parents have been found for %s',
old_location
unicode(locator)
)
# this should blow up if we don't find any parents, which would be erroneous