Skip to content

Commit

Permalink
Removed unnecessary list() calls on sorted().
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Dec 28, 2023
1 parent 63076e3 commit ebf9320
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/generic_views/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_date_list_order(self):
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):
Expand Down Expand Up @@ -357,7 +357,7 @@ def test_date_list_order(self):
_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")
Expand Down Expand Up @@ -542,7 +542,7 @@ def test_date_list_order(self):
_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"])
)


Expand Down

0 comments on commit ebf9320

Please sign in to comment.