@@ -191,7 +191,6 @@ def test_export_with_choice_lists(self):
191191 '' ,
192192 'traditionnel' ]])
193193
194-
195194 def test_headers_of_group_exports (self ):
196195 title , schemas , submissions = build_fixture ('grouped_questions' )
197196 fp = FormPack (schemas , title )
@@ -1746,3 +1745,34 @@ def test_untranslated_spss_labels(self):
17461745 assert actual .read () == expected .read ()
17471746 zipped .close ()
17481747 raw_zip .close ()
1748+
1749+ def test_select_multiple_with_different_options_in_multiple_versions (self ):
1750+ title , schemas , submissions = build_fixture ('favorite_coffee' )
1751+ fp = FormPack (schemas , title )
1752+ self .assertEqual (len (fp .versions ), 2 )
1753+
1754+ export = fp .export (versions = fp .versions .keys ()).to_dict (submissions )
1755+
1756+ headers = export ['Favorite coffee' ]['fields' ]
1757+ self .assertListEqual (headers , [
1758+ 'favorite_coffee_type' ,
1759+ 'favorite_coffee_type/french' ,
1760+ 'favorite_coffee_type/italian' ,
1761+ 'favorite_coffee_type/american' ,
1762+ 'favorite_coffee_type/british' ,
1763+ 'brand_of_coffee_machine'
1764+ ])
1765+
1766+ # Check length of each row
1767+ for row in export ['Favorite coffee' ]['data' ]:
1768+ self .assertEqual (len (headers ), len (row ))
1769+
1770+ # Ensure latest submissions is not shifted
1771+ self .assertListEqual (export ['Favorite coffee' ]['data' ][- 1 ], [
1772+ 'american british' ,
1773+ '0' ,
1774+ '0' ,
1775+ '1' ,
1776+ '1' ,
1777+ 'Keurig'
1778+ ])
0 commit comments