1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #32469 -- Made assertQuerysetEqual() respect maxDiff when ordered=False.

This commit is contained in:
Nick Pope
2021-02-21 15:37:03 +00:00
committed by Mariusz Felisiak
parent 87acbf0631
commit 0e4e35722a
2 changed files with 32 additions and 1 deletions

View File

@@ -1062,7 +1062,7 @@ class TransactionTestCase(SimpleTestCase):
if transform is not None:
items = map(transform, items)
if not ordered:
return self.assertEqual(Counter(items), Counter(values), msg=msg)
return self.assertDictEqual(Counter(items), Counter(values), msg=msg)
# For example qs.iterator() could be passed as qs, but it does not
# have 'ordered' attribute.
if len(values) > 1 and hasattr(qs, 'ordered') and not qs.ordered: