summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Clauss <cclauss@me.com>2023-12-28 10:58:37 +0100
committerGitHub <noreply@github.com>2023-12-28 10:58:37 +0100
commitebf9320838587fba1d7a88b303ddf216e398e6be (patch)
tree89a1b6328e79731eb7d669f56059bda15668fde2 /tests
parent63076e36931e365745c21b1d45e426b3ba3dde70 (diff)
Removed unnecessary list() calls on sorted().
Diffstat (limited to 'tests')
-rw-r--r--tests/generic_views/test_dates.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/generic_views/test_dates.py b/tests/generic_views/test_dates.py
index 90476270cc..fc680f4209 100644
--- a/tests/generic_views/test_dates.py
+++ b/tests/generic_views/test_dates.py
@@ -170,7 +170,7 @@ class ArchiveIndexViewTests(TestDataMixin, TestCase):
self.assertEqual(res.status_code, 200)
self.assertEqual(
list(res.context["date_list"]),
- list(reversed(sorted(res.context["date_list"]))),
+ sorted(res.context["date_list"], reverse=True),
)
def test_archive_view_custom_sorting(self):
@@ -357,7 +357,7 @@ class YearArchiveViewTests(TestDataMixin, TestCase):
_make_books(10, base_date=datetime.date(2011, 12, 25))
res = self.client.get("/dates/books/2011/")
self.assertEqual(
- list(res.context["date_list"]), list(sorted(res.context["date_list"]))
+ list(res.context["date_list"]), sorted(res.context["date_list"])
)
@mock.patch("django.views.generic.list.MultipleObjectMixin.get_context_data")
@@ -542,7 +542,7 @@ class MonthArchiveViewTests(TestDataMixin, TestCase):
_make_books(10, base_date=datetime.date(2011, 12, 25))
res = self.client.get("/dates/books/2011/dec/")
self.assertEqual(
- list(res.context["date_list"]), list(sorted(res.context["date_list"]))
+ list(res.context["date_list"]), sorted(res.context["date_list"])
)