From cac669364f6b01bfc840b2e571b6613fa084bc2f Mon Sep 17 00:00:00 2001 From: ichuang Date: Mon, 10 Mar 2014 13:51:02 +0000 Subject: [PATCH] more robust capa math preprocessor test, and new test for inline --- common/lib/capa/capa/tests/test_input_templates.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/lib/capa/capa/tests/test_input_templates.py b/common/lib/capa/capa/tests/test_input_templates.py index b77a2ce458..a5a3d27753 100644 --- a/common/lib/capa/capa/tests/test_input_templates.py +++ b/common/lib/capa/capa/tests/test_input_templates.py @@ -431,12 +431,21 @@ class TextlineTemplateTest(TemplateTestCase): 'script_src': 'test_script'} xml = self.render_to_xml(self.context) - xpath = "//div[@class='text-input-dynamath_data ' and @data-preprocessor='test_class']" + xpath = "//div[contains(@class, 'text-input-dynamath_data') and @data-preprocessor='test_class']" self.assert_has_xpath(xml, xpath, self.context) xpath = "//div[@class='script_placeholder' and @data-src='test_script']" self.assert_has_xpath(xml, xpath, self.context) + def test_do_inline_and_preprocessor(self): + self.context['preprocessor'] = {'class_name': 'test_class', + 'script_src': 'test_script'} + self.context['inline'] = True + xml = self.render_to_xml(self.context) + + xpath = "//div[contains(@class, 'text-input-dynamath_data inline') and @data-preprocessor='test_class']" + self.assert_has_xpath(xml, xpath, self.context) + def test_do_inline(self): cases = [('correct', 'correct'), ('unsubmitted', 'unanswered'),