title: Python unittest - asserting dictionary with lists
body: <p>While writing some tests for my class, I encountered interesting simple problem. I would like to assertDictEqual two dictionaries containing some list. But this lists may not be sorted in a same way -> which results in failed test</p>
  
  <p>Example:</p>
  
  <pre><code>def test_myobject_export_into_dictionary(self):
      obj = MyObject()
      resulting_dictionary = {
              'state': 2347,
              'neighbours': [1,2,3]
          }
      self.assertDictEqual(resulting_dictionary, obj.exportToDict())
  </code></pre>
  
  <p>This fail from time to time, depending on order of elements in list</p>
  
  <pre><code>FAIL: test_myobject_export_into_dictionary
  ------------------------------------
  -  'neighbours': [1,2,3],
  +  'neighbours': [1,3,2],
  </code></pre>
  
  <p>Any ideas how to assert this in a simple way?</p>
  
  <p>I was thinking about using <code>set</code> instead of <code>list</code> or sorting lists before comparison.</p>