Commit 96420f30 by Diana Huang

Minor cleanups

Remove unnecessary check.
Fix merge conflict
parent 97331d4c
...@@ -293,7 +293,6 @@ class CourseTestCase(ModuleStoreTestCase): ...@@ -293,7 +293,6 @@ class CourseTestCase(ModuleStoreTestCase):
for descriptor in items: for descriptor in items:
resp = self.client.get_html(get_url('unit_handler', descriptor.location)) resp = self.client.get_html(get_url('unit_handler', descriptor.location))
self.assertEqual(resp.status_code, 200) self.assertEqual(resp.status_code, 200)
test_no_locations(self, resp)
def assertAssetsEqual(self, asset_key, course1_id, course2_id): def assertAssetsEqual(self, asset_key, course1_id, course2_id):
"""Verifies the asset of the given key has the same attributes in both given courses.""" """Verifies the asset of the given key has the same attributes in both given courses."""
...@@ -310,22 +309,6 @@ class CourseTestCase(ModuleStoreTestCase): ...@@ -310,22 +309,6 @@ class CourseTestCase(ModuleStoreTestCase):
self.assertEqual(value, course2_asset_attrs[key]) self.assertEqual(value, course2_asset_attrs[key])
def test_no_locations(test, resp, status_code=200, html=True):
"""
Verifies that "i4x", which appears in old locations, but not
new locators, does not appear in the HTML response output.
Used to verify that database refactoring is complete.
"""
test.assertNotContains(resp, 'i4x', status_code=status_code, html=html)
if html:
# For HTML pages, it is nice to call the method with html=True because
# it checks that the HTML properly parses. However, it won't find i4x usages
# in JavaScript blocks.
content = resp.content
hits = len(re.findall(r"(?<!jump_to/)i4x://", content))
test.assertEqual(hits, 0, "i4x found outside of LMS jump-to links")
def get_url(handler_name, key_value, key_name='usage_key_string', kwargs=None): def get_url(handler_name, key_value, key_name='usage_key_string', kwargs=None):
""" """
Helper function for getting HTML for a page in Studio and checking that it does not error. Helper function for getting HTML for a page in Studio and checking that it does not error.
......
...@@ -363,11 +363,7 @@ class TestMixedModuleStore(LocMapperSetupSansDjango): ...@@ -363,11 +363,7 @@ class TestMixedModuleStore(LocMapperSetupSansDjango):
xml_store = self.store._get_modulestore_by_type(ModuleStoreEnum.Type.xml) xml_store = self.store._get_modulestore_by_type(ModuleStoreEnum.Type.xml)
# the important thing is not which exception it raises but that it raises an exception # the important thing is not which exception it raises but that it raises an exception
with self.assertRaises(AttributeError): with self.assertRaises(AttributeError):
<<<<<<< HEAD xml_store.create_course("org", "course", "run", self.user_id)
xml_store.create_course("org", "course/run", self.user_id)
=======
xml_store.create_course("org", "course", "run", 999)
>>>>>>> Fix up the signature to use course and run instead of just offering
@ddt.data('draft', 'split') @ddt.data('draft', 'split')
def test_get_course(self, default_ms): def test_get_course(self, default_ms):
......
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