From 4b7d1deb253f55d348e849498a5500bdea3ceade Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Wed, 6 Mar 2013 10:34:57 -0500 Subject: [PATCH] Fix a bug in extracting HTML Update tests to reflect new behavior. --- common/lib/capa/capa/capa_problem.py | 2 +- common/lib/capa/capa/tests/test_html_render.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/lib/capa/capa/capa_problem.py b/common/lib/capa/capa/capa_problem.py index 62751cd833..14c590a660 100644 --- a/common/lib/capa/capa/capa_problem.py +++ b/common/lib/capa/capa/capa_problem.py @@ -331,7 +331,7 @@ class LoncapaProblem(object): ''' Main method called externally to get the HTML to be rendered for this capa Problem. ''' - html = contextualize_text(etree.tostring(self.extracted_tree), self.context) + html = contextualize_text(etree.tostring(self._extract_html(self.tree)), self.context) return html diff --git a/common/lib/capa/capa/tests/test_html_render.py b/common/lib/capa/capa/tests/test_html_render.py index 64f031ea59..e4c54edca0 100644 --- a/common/lib/capa/capa/tests/test_html_render.py +++ b/common/lib/capa/capa/tests/test_html_render.py @@ -125,6 +125,8 @@ class CapaHtmlRenderTest(unittest.TestCase): expected_solution_context = {'id': '1_solution_1'} expected_calls = [mock.call('textline.html', expected_textline_context), + mock.call('solutionspan.html', expected_solution_context), + mock.call('textline.html', expected_textline_context), mock.call('solutionspan.html', expected_solution_context)] self.assertEqual(test_system.render_template.call_args_list,