summaryrefslogtreecommitdiff
path: root/tests/prefetch_related
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2020-10-18 18:29:52 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-11-06 09:24:50 +0100
commit3f7b3275627385f8f7531fca01cdda50d4ec6b6e (patch)
treefb082d40e73f6c877911eab92229ac21cdfaa5bc /tests/prefetch_related
parent13b6fff11703a694e155b84d41d02822bbc0aaa0 (diff)
downloaddjango-3f7b3275627385f8f7531fca01cdda50d4ec6b6e.tar.gz
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>
Diffstat (limited to 'tests/prefetch_related')
-rw-r--r--tests/prefetch_related/tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/prefetch_related/tests.py b/tests/prefetch_related/tests.py
index c368e040ea..e21bd5ec23 100644
--- a/tests/prefetch_related/tests.py
+++ b/tests/prefetch_related/tests.py
@@ -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])