more robust capa math preprocessor test, and new test for inline

This commit is contained in:
ichuang
2014-03-10 13:51:02 +00:00
parent a35d524de2
commit cac669364f

View File

@@ -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'),