Commit 78424e16 by Diana Huang

Fix some of the tests so that they work with the new changes

to capa_problem
parent 17680a33
...@@ -108,7 +108,9 @@ class CapaFactory(object): ...@@ -108,7 +108,9 @@ class CapaFactory(object):
else: else:
instance_state = None instance_state = None
module = CapaModule(test_system(), location, system = test_system()
system.render_template = Mock(return_value="<div>Test Template HTML</div>")
module = CapaModule(system, location,
definition, descriptor, definition, descriptor,
instance_state, None, metadata=metadata) instance_state, None, metadata=metadata)
...@@ -185,6 +187,7 @@ class CapaModuleTest(unittest.TestCase): ...@@ -185,6 +187,7 @@ class CapaModuleTest(unittest.TestCase):
max_attempts="1", max_attempts="1",
attempts="0", attempts="0",
due=self.yesterday_str) due=self.yesterday_str)
self.assertTrue(after_due_date.answer_available()) self.assertTrue(after_due_date.answer_available())
......
...@@ -106,7 +106,7 @@ class ConditionalModuleTest(unittest.TestCase): ...@@ -106,7 +106,7 @@ class ConditionalModuleTest(unittest.TestCase):
html = module.get_html() html = module.get_html()
print "html type: ", type(html) print "html type: ", type(html)
print "html: ", html print "html: ", html
html_expect = "<div>{'ajax_url': 'courses/course_id/modx/a_location', 'element_id': 'i4x-edX-cond_test-conditional-condone', 'id': 'i4x://edX/cond_test/conditional/condone'}</div>" html_expect = "{'ajax_url': 'courses/course_id/modx/a_location', 'element_id': 'i4x-edX-cond_test-conditional-condone', 'id': 'i4x://edX/cond_test/conditional/condone'}"
self.assertEqual(html, html_expect) self.assertEqual(html, html_expect)
gdi = module.get_display_items() gdi = module.get_display_items()
......
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