aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2022-01-31 22:52:08 +0100
committerGravatar Leon Sandøy <[email protected]>2022-01-31 22:52:08 +0100
commit47248a0a1e183871879ad1506b08a19a0b2042f4 (patch)
treea07b8979b38d8c9ff71b81df3af7ff2dda73d84f /pydis_site/apps/resources
parentRevert changes to pyproject.toml. (diff)
Add more tests for the new resources page.
Coverage is now 100%.
Diffstat (limited to 'pydis_site/apps/resources')
-rw-r--r--pydis_site/apps/resources/tests/test_views.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py
index 0af5ce5f..a2a203ce 100644
--- a/pydis_site/apps/resources/tests/test_views.py
+++ b/pydis_site/apps/resources/tests/test_views.py
@@ -15,3 +15,15 @@ class TestResourcesView(TestCase):
url = reverse("resources:index")
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
+
+ def test_resources_with_valid_argument(self):
+ """Check that you can resolve the resources when passing a valid argument."""
+ url = reverse("resources:index", kwargs={"resource_type": "book"})
+ response = self.client.get(url)
+ self.assertEqual(response.status_code, 200)
+
+ def test_resources_with_invalid_argument(self):
+ """Check that you can resolve the resources when passing an invalid argument."""
+ url = reverse("resources:index", kwargs={"resource_type": "urinal-cake"})
+ response = self.client.get(url)
+ self.assertEqual(response.status_code, 404)