diff options
author | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-08-13 17:54:24 (GMT) |
---|---|---|
committer | Rogelio Mita <rogeliomita@activitycentral.com> | 2013-08-13 17:54:24 (GMT) |
commit | fcc7fb22e6d9e112d4ce443faffd3fa2cb6a73ba (patch) | |
tree | 8c2ab6e68c09cd88fa739ad17b975dd5035cbda3 /webapp/polls/tests/result_tests.py | |
parent | 9706ebab4b562767f0243da92df2891949b7033b (diff) |
issue 4429 - BugFix: options col name is ordered by order key from structure of poll
Diffstat (limited to 'webapp/polls/tests/result_tests.py')
-rw-r--r-- | webapp/polls/tests/result_tests.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/webapp/polls/tests/result_tests.py b/webapp/polls/tests/result_tests.py index 9a646ba..ad7784f 100644 --- a/webapp/polls/tests/result_tests.py +++ b/webapp/polls/tests/result_tests.py @@ -153,15 +153,17 @@ class PollResultTests(MongoTestCase): "dependence": {}, "name": "Q: ImageCheckBox", "options": { - "1370786178812": { - "img_name": "1370786178812.jpg", - "type": "img_input", - "weight": 1 - }, "1370786178813": { "img_name": "1370786178813.jpg", "type": "img_input", - "weight": 2 + "weight": 2, + "order": "1" + }, + "1370786178812": { + "img_name": "1370786178812.jpg", + "type": "img_input", + "weight": 1, + "order": "2" } } }, @@ -172,11 +174,13 @@ class PollResultTests(MongoTestCase): "options": { "1370786178809": { "text": "option 1", - "weight": 1 + "weight": 1, + "order": "1" }, "1370786178810": { "text": "option 2", - "weight": 2 + "weight": 2, + "order": "2" } } } @@ -347,13 +351,13 @@ class PollResultTests(MongoTestCase): poll_result = PollResult(data=result_data) expected_header = unicode( "RUEE;DEPARTAMENTO;NUM_ESC;GRADO;GRUPO;" + - "TIPO_GRUPO;option 1;option 2;1370786178812;1370786178813;" + + "TIPO_GRUPO;option 1;option 2;1370786178813;1370786178812;" + "Q: TextInput con ácento;Q: RadioButton con ácento;" + "Q: DropDownList;Q: ImageRadioButton;", 'utf-8') self.assertEqual(expected_header, poll_result.get_csv_header()) csv = poll_result.to_csv() - record = "1101236;MONTEVIDEO;236;2;A;1;1;2;1;;some text;1;1;1;" + record = "1101236;MONTEVIDEO;236;2;A;1;1;2;;1;some text;1;1;1;" self.assertTrue(expected_header in csv) self.assertTrue(record in csv) |