mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.
This also replaces assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate. Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
parent
13b6fff117
commit
3f7b327562
39 changed files with 1447 additions and 1801 deletions
|
@ -76,7 +76,7 @@ class PrefetchRelatedTests(TestDataMixin, TestCase):
|
|||
[list(b.first_time_authors.all())
|
||||
for b in Book.objects.prefetch_related('first_time_authors')]
|
||||
|
||||
self.assertQuerysetEqual(self.book2.authors.all(), ["<Author: Charlotte>"])
|
||||
self.assertSequenceEqual(self.book2.authors.all(), [self.author1])
|
||||
|
||||
def test_onetoone_reverse_no_match(self):
|
||||
# Regression for #17439
|
||||
|
@ -1580,4 +1580,4 @@ class ReadPrefetchedObjectsCacheTests(TestCase):
|
|||
)
|
||||
with self.assertNumQueries(4):
|
||||
# AuthorWithAge -> Author -> FavoriteAuthors, Book
|
||||
self.assertQuerysetEqual(authors, ['<AuthorWithAge: Rousseau>', '<AuthorWithAge: Voltaire>'])
|
||||
self.assertSequenceEqual(authors, [self.author1, self.author2])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue