title: How to achieve assertDictEqual with assertSequenceEqual applied to values
body: <p>I know that, when performing <code>assertEqual</code> on a dictionary, <code>assertDictEqual</code> is called.  Similarly, <code>assertEqual</code> on a sequence will perform <code>assertSequenceEqual</code>.</p>
  
  <p>However, when <code>assertDictEqual</code> is comparing values, it appears not to make use of <code>assertEqual</code>, and thus <code>assertSequenceEqual</code> is not called.</p>
  
  <p>Consider the following simple dictionaries:</p>
  
  <pre><code>lst1 = [1, 2]
  lst2 = [2, 1]
  
  d1 = {'key': lst1}
  d2 = {'key': lst2}
  
  self.assertEqual(lst1, lst2) # True
  self.assertEqual(d1, d2) # False &gt;&lt;
  </code></pre>
  
  <p>How can I test dictionaries such as <code>d1</code> and <code>d2</code> such that their equality is properly compared, by recursively applying <code>assertEqual</code>-like semantics to values?</p>
  
  <p>I want to avoid using external modules (as suggested <a href="https://stackoverflow.com/questions/14491164/python-unittest-asserting-dictionary-with-lists">in this question</a>) if at all possible, unless they are native django extensions.</p>
  
  <hr>
  
  <p>EDIT</p>
  
  <p>Essentially, what I am after is a built in version of this:</p>
  
  <pre><code>def assertDictEqualUnorderedValues(self, d1, d2):
      for k,v1 in d1.iteritems():
          if k not in d2:
              self.fail('Key %s missing in %s'%(k, d2))
  
          v2 = d2[k]
  
          if isinstance(v1, Collections.iterable) and not isinstance(v1, basestring):
              self.assertValuesEqual(v1, v2)
          else:
              self.assertEqual(v1, v2)
  </code></pre>
  
  <p>The problem with the above code is that the error messages are not as nice as the builtin asserts, and there's probably edge cases I've ignored (as I just wrote that off the top of my head).</p>