diff --git a/common/lib/capa/capa/chem/tests.py b/common/lib/capa/capa/chem/tests.py index 7f9ceba6e0..9d415ad402 100644 --- a/common/lib/capa/capa/chem/tests.py +++ b/common/lib/capa/capa/chem/tests.py @@ -212,63 +212,63 @@ class Test_Render_Equations(unittest.TestCase): def test_render1(self): s = "H2O + CO2" out = render_to_html(s) - correct = "H2O+CO2" + correct = u'H2O+CO2' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render_uncorrect_reaction(self): s = "O2C + OH2" out = render_to_html(s) - correct = "O2C+OH2" + correct = u'O2C+OH2' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render2(self): s = "CO2 + H2O + Fe(OH)3" out = render_to_html(s) - correct = "CO2+H2O+Fe(OH)3" + correct = u'CO2+H2O+Fe(OH)3' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render3(self): s = "3H2O + 2CO2" out = render_to_html(s) - correct = "3H2O+2CO2" + correct = u'3H2O+2CO2' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render4(self): s = "H^+ + OH^-" out = render_to_html(s) - correct = "H++OH-" + correct = u'H++OH-' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render5(self): s = "Fe(OH)^2- + (OH)^-" out = render_to_html(s) - correct = "Fe(OH)2-+(OH)-" + correct = u'Fe(OH)2-+(OH)-' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render6(self): s = "7/2H^+ + 3/5OH^-" out = render_to_html(s) - correct = "72H++35OH-" + correct = u'72H++35OH-' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render7(self): s = "5(H1H212)^70010- + 2H2O + 7/2HCl + H2O" out = render_to_html(s) - correct = "5(H1H212)70010-+2H2O+72HCl+H2O" + correct = u'5(H1H212)70010-+2H2O+72HCl+H2O' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render8(self): s = "H2O(s) + CO2" out = render_to_html(s) - correct = "H2O(s)+CO2" + correct = u'H2O(s)+CO2' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) @@ -276,18 +276,21 @@ class Test_Render_Equations(unittest.TestCase): s = "5[Ni(NH3)4]^2+ + 5/2SO4^2-" #import ipdb; ipdb.set_trace() out = render_to_html(s) - correct = "5[Ni(NH3)4]2++52SO42-" + correct = u'5[Ni(NH3)4]2++52SO42-' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct) def test_render_error(self): s = "5.2H20" - self.assertRaises(ParseException, render_to_html, s) + out = render_to_html(s) + correct = u'5.2H20' + log(out + ' ------- ' + correct, 'html') + self.assertEqual(out, correct) def test_render_simple_brackets(self): s = "(Ar)" out = render_to_html(s) - correct = "(Ar)" + correct = u'(Ar)' log(out + ' ------- ' + correct, 'html') self.assertEqual(out, correct)