aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pydis_site/apps/resources/tests/test_views.py12
-rw-r--r--pyproject.toml1
2 files changed, 13 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)
diff --git a/pyproject.toml b/pyproject.toml
index 6392f871..b350836e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -51,6 +51,7 @@ start = "python manage.py run --debug"
makemigrations = "python manage.py makemigrations"
django_shell = "python manage.py shell"
test = "coverage run manage.py test"
+coverage = "coverage run manage.py test --no-input; coverage report -m"
report = "coverage report -m"
lint = "pre-commit run --all-files"
precommit = "pre-commit install"