From 09e18cb8159e58d03f77c9d199e1aacb2af57283 Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Wed, 10 Apr 2013 17:38:31 -0400 Subject: [PATCH] Add in tests for alternate xml orderings --- .../xmodule/tests/test_combined_open_ended.py | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py b/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py index 3f55d22f14..8c192929b0 100644 --- a/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py +++ b/common/lib/xmodule/xmodule/tests/test_combined_open_ended.py @@ -354,7 +354,11 @@ class CombinedOpenEndedModuleTest(unittest.TestCase): ''' definition = {'prompt': etree.XML(prompt), 'rubric': etree.XML(rubric), 'task_xml': [task_xml1, task_xml2]} full_definition = definition_template.format(prompt=prompt, rubric=rubric, task1=task_xml1, task2=task_xml2) + definition_oe = {'prompt': etree.XML(prompt), 'rubric': etree.XML(rubric), 'task_xml': [task_xml2, task_xml2]} + definition_sa = {'prompt': etree.XML(prompt), 'rubric': etree.XML(rubric), 'task_xml': [task_xml1, task_xml1]} descriptor = Mock(data=full_definition) + descriptor_oe = Mock(data=definition_oe) + descriptor_sa = Mock(data=definition_sa) test_system = test_system() combinedoe_container = CombinedOpenEndedModule(test_system, location, @@ -371,6 +375,20 @@ class CombinedOpenEndedModuleTest(unittest.TestCase): static_data=self.static_data, metadata=self.metadata, instance_state=self.static_data) + self.combinedoe_oe = CombinedOpenEndedV1Module(self.test_system, + self.location, + self.definition_oe, + self.descriptor_oe, + static_data=self.static_data, + metadata=self.metadata, + instance_state=self.static_data) + self.combinedoe_sa = CombinedOpenEndedV1Module(self.test_system, + self.location, + self.definition_sa, + self.descriptor_sa, + static_data=self.static_data, + metadata=self.metadata, + instance_state=self.static_data) def test_get_tag_name(self): name = self.combinedoe.get_tag_name("Tag") @@ -413,4 +431,13 @@ class CombinedOpenEndedModuleTest(unittest.TestCase): self.assertEqual(score_dict['score'], None) self.assertEqual(score_dict['total'], None) + def test_open_ended_task_order(self): + changed = self.combinedoe_oe.update_task_states() + self.assertFalse(changed) + + def test_self_assessment_task_order(self): + changed = self.combinedoe_sa.update_task_states() + self.assertFalse(changed) + +