Commit 96d81bce by Vasyl Nakvasiuk

fix conditional module

parent 67ada1fb
...@@ -277,7 +277,6 @@ class Test_Render_Equations(unittest.TestCase): ...@@ -277,7 +277,6 @@ class Test_Render_Equations(unittest.TestCase):
def test_render9(self): def test_render9(self):
s = "5[Ni(NH3)4]^2+ + 5/2SO4^2-" s = "5[Ni(NH3)4]^2+ + 5/2SO4^2-"
#import ipdb; ipdb.set_trace()
out = render_to_html(s) out = render_to_html(s)
correct = u'<span class="math">5[Ni(NH<sub>3</sub>)<sub>4</sub>]<sup>2+</sup>+<sup>5</sup>&frasl;<sub>2</sub>SO<sub>4</sub><sup>2-</sup></span>' correct = u'<span class="math">5[Ni(NH<sub>3</sub>)<sub>4</sub>]<sup>2+</sup>+<sup>5</sup>&frasl;<sub>2</sub>SO<sub>4</sub><sup>2-</sup></span>'
log(out + ' ------- ' + correct, 'html') log(out + ' ------- ' + correct, 'html')
...@@ -311,7 +310,7 @@ class Test_Render_Equations(unittest.TestCase): ...@@ -311,7 +310,7 @@ class Test_Render_Equations(unittest.TestCase):
log(out + ' ------- ' + correct, 'html') log(out + ' ------- ' + correct, 'html')
self.assertEqual(out, correct) self.assertEqual(out, correct)
def test_render_eq3(self): def test_render_eq3(self):
s = "H^+ + OH^- <= H2O" # unsupported arrow s = "H^+ + OH^- <= H2O" # unsupported arrow
out = render_to_html(s) out = render_to_html(s)
......
...@@ -59,7 +59,7 @@ class ConditionalModule(XModule): ...@@ -59,7 +59,7 @@ class ConditionalModule(XModule):
% xml_attr) % xml_attr)
def is_condition_satisfied(self): def is_condition_satisfied(self):
self.required_modules = [self.system.get_module(descriptor) for self.required_modules = [self.system.get_module(descriptor.location) for
descriptor in self.descriptor.get_required_module_descriptors()] descriptor in self.descriptor.get_required_module_descriptors()]
xml_value, attr_name = self._get_condition() xml_value, attr_name = self._get_condition()
......
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