aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/tests
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2019-09-21 00:01:23 +0200
committerGravatar GitHub <[email protected]>2019-09-21 00:01:23 +0200
commit7c47ba7aa3079e96c2b8327aab3ef3379d6683f2 (patch)
tree87a38148e23b2c443c8679b474cf8aa4a5c05f1c /pydis_site/apps/api/tests
parentMerge pull request #250 from python-discord/container-refinement (diff)
parentMerge branch 'master' into infractions-default-ordering (diff)
Merge pull request #249 from python-discord/infractions-default-ordering
Make API return infraction list with newest first
Diffstat (limited to 'pydis_site/apps/api/tests')
-rw-r--r--pydis_site/apps/api/tests/test_infractions.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pydis_site/apps/api/tests/test_infractions.py b/pydis_site/apps/api/tests/test_infractions.py
index 7c370c17..0092d355 100644
--- a/pydis_site/apps/api/tests/test_infractions.py
+++ b/pydis_site/apps/api/tests/test_infractions.py
@@ -63,6 +63,7 @@ class InfractionTests(APISubdomainTestCase):
)
def test_list_all(self):
+ """Tests the list-view, which should be ordered by inserted_at (newest first)."""
url = reverse('bot:infraction-list', host='api')
response = self.client.get(url)
@@ -70,8 +71,8 @@ class InfractionTests(APISubdomainTestCase):
infractions = response.json()
self.assertEqual(len(infractions), 2)
- self.assertEqual(infractions[0]['id'], self.ban_hidden.id)
- self.assertEqual(infractions[1]['id'], self.ban_inactive.id)
+ self.assertEqual(infractions[0]['id'], self.ban_inactive.id)
+ self.assertEqual(infractions[1]['id'], self.ban_hidden.id)
def test_filter_search(self):
url = reverse('bot:infraction-list', host='api')