aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources/tests
diff options
context:
space:
mode:
authorGravatar jchristgit <[email protected]>2025-03-02 14:51:10 +0100
committerGravatar GitHub <[email protected]>2025-03-02 14:51:10 +0100
commit72e8f43fa30253589197813e477e67d28549a8bb (patch)
treed828c8b7f572b60dcd48bc688957e3ba3a615d5e /pydis_site/apps/resources/tests
parentMerge pull request #1444 from kkrypt0nn/patch-heroku-vps-guide (diff)
parentAdd endpoint to fetch filters in JSON format (diff)
Merge pull request #1166 from python-discord/resource-filter-fetch
Add endpoint to fetch filters in JSON format
Diffstat (limited to 'pydis_site/apps/resources/tests')
-rw-r--r--pydis_site/apps/resources/tests/test_views.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py
index a2a203ce..72c9ed95 100644
--- a/pydis_site/apps/resources/tests/test_views.py
+++ b/pydis_site/apps/resources/tests/test_views.py
@@ -27,3 +27,14 @@ class TestResourcesView(TestCase):
url = reverse("resources:index", kwargs={"resource_type": "urinal-cake"})
response = self.client.get(url)
self.assertEqual(response.status_code, 404)
+
+
+class TestResourceFilterView(TestCase):
+ def test_resource_filter_response(self):
+ """Check that the filter endpoint returns JSON-formatted filters."""
+ url = reverse('resources:filters')
+ response = self.client.get(url)
+ self.assertEqual(response.status_code, 200)
+ content = response.json()
+ self.assertIn('difficulty', content)
+ self.assertIsInstance(content['difficulty'], list)