summaryrefslogtreecommitdiff
path: root/tests/custom_columns
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-10-07 13:05:35 +0200
committerGitHub <noreply@github.com>2022-10-07 13:05:35 +0200
commitd795259ea96004df0a2469246229a146307bcd2c (patch)
tree96d797dacdb7b4c68cd32afc1f2ed6f15e0a2bcd /tests/custom_columns
parent564b317fb53e9925b86ca5ef5d3bbcf99387602c (diff)
downloaddjango-d795259ea96004df0a2469246229a146307bcd2c.tar.gz
Replaced assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate.
Follow up to 3f7b3275627385f8f7531fca01cdda50d4ec6b6e.
Diffstat (limited to 'tests/custom_columns')
-rw-r--r--tests/custom_columns/tests.py29
1 files changed, 6 insertions, 23 deletions
diff --git a/tests/custom_columns/tests.py b/tests/custom_columns/tests.py
index c6b775a3ef..6d9e9f71cf 100644
--- a/tests/custom_columns/tests.py
+++ b/tests/custom_columns/tests.py
@@ -17,14 +17,7 @@ class CustomColumnsTests(TestCase):
cls.article.authors.set(cls.authors)
def test_query_all_available_authors(self):
- self.assertQuerysetEqual(
- Author.objects.all(),
- [
- "Peter Jones",
- "John Smith",
- ],
- str,
- )
+ self.assertSequenceEqual(Author.objects.all(), [self.a2, self.a1])
def test_get_first_name(self):
self.assertEqual(
@@ -33,12 +26,9 @@ class CustomColumnsTests(TestCase):
)
def test_filter_first_name(self):
- self.assertQuerysetEqual(
+ self.assertSequenceEqual(
Author.objects.filter(first_name__exact="John"),
- [
- "John Smith",
- ],
- str,
+ [self.a1],
)
def test_field_error(self):
@@ -57,14 +47,7 @@ class CustomColumnsTests(TestCase):
self.a1.last
def test_get_all_authors_for_an_article(self):
- self.assertQuerysetEqual(
- self.article.authors.all(),
- [
- "Peter Jones",
- "John Smith",
- ],
- str,
- )
+ self.assertSequenceEqual(self.article.authors.all(), [self.a2, self.a1])
def test_get_all_articles_for_an_author(self):
self.assertQuerysetEqual(
@@ -76,8 +59,8 @@ class CustomColumnsTests(TestCase):
)
def test_get_author_m2m_relation(self):
- self.assertQuerysetEqual(
- self.article.authors.filter(last_name="Jones"), ["Peter Jones"], str
+ self.assertSequenceEqual(
+ self.article.authors.filter(last_name="Jones"), [self.a2]
)
def test_author_querying(self):