Skip to content
Snippets Groups Projects
Commit 7a2aaa09 authored by jinder1s's avatar jinder1s
Browse files

random.shuffle compatibility fix between python 2.7 and 3.5

parent 4b64a44c
No related merge requests found
......@@ -3,6 +3,7 @@ from __future__ import absolute_import, print_function
import textwrap
import unittest
import six
from capa.responsetypes import LoncapaProblemError
from capa.tests.helpers import new_loncapa_problem, test_capa_system
......@@ -58,7 +59,10 @@ class CapaShuffleTest(unittest.TestCase):
response = list(problem.responders.values())[0]
self.assertFalse(response.has_mask())
self.assertTrue(response.has_shuffle())
self.assertEqual(response.unmask_order(), ['choice_0', 'choice_aaa', 'choice_1', 'choice_ddd'])
if six.PY2:
self.assertEqual(response.unmask_order(), ['choice_0', 'choice_aaa', 'choice_1', 'choice_ddd'])
else:
self.assertEqual(response.unmask_order(), ['choice_1', 'choice_aaa', 'choice_0', 'choice_ddd'])
def test_shuffle_different_seed(self):
xml_str = textwrap.dedent("""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment