mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +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:
committed by
Mariusz Felisiak
parent
13b6fff117
commit
3f7b327562
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user