From fb985fac9e70dda73833be718f6f520784c9a0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sun, 21 Jun 2026 13:56:45 +0200 Subject: [PATCH] test(games): make list_games sort test discriminate from default order (#68) --- tests/test_sorting.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_sorting.py b/tests/test_sorting.py index a76bdf2..268444d 100644 --- a/tests/test_sorting.py +++ b/tests/test_sorting.py @@ -155,6 +155,10 @@ class TestListGamesSort: assert response.status_code == 200 body = response.content.decode() assert body.index("Beta") < body.index("Alpha") + # ascending name must flip order vs the default (-created → Beta first) + ascending = logged_client.get(reverse("games:list_games"), {"sort": "name"}) + ascending_body = ascending.content.decode() + assert ascending_body.index("Alpha") < ascending_body.index("Beta") def test_unknown_sort_emits_warning_message(self, logged_client, two_games): response = logged_client.get(reverse("games:list_games"), {"sort": "bogus"})