I am doing a unit test on two list of list values:
self.assertEqual(sale, [['1',14], ['2',5], ['3',7], ['4',1]])
But it gives the below error:
AssertionError: Lists differ: [['1', 14], ['4', 1], ['2', 5], ['3', 7]] != [['1'
, 14], ['2', 5], ['3', 7], ['4', 1]]
First differing element 1:
['4', 1]
['2', 5]
- [['1', 14], ['4', 1], ['2', 5], ['3', 7]]
+ [['1', 14], ['2', 5], ['3', 7], ['4', 1]]
How can I make this scenario pass, Prevent the assertEqual function to avoid checking the order of the elements in the list.
1, 1, 2
vs1, 2, 2