File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
pydis_site/apps/resources/tests Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -15,3 +15,15 @@ def test_resources_index_200(self):
15
15
url = reverse ("resources:index" )
16
16
response = self .client .get (url )
17
17
self .assertEqual (response .status_code , 200 )
18
+
19
+ def test_resources_with_valid_argument (self ):
20
+ """Check that you can resolve the resources when passing a valid argument."""
21
+ url = reverse ("resources:index" , kwargs = {"resource_type" : "book" })
22
+ response = self .client .get (url )
23
+ self .assertEqual (response .status_code , 200 )
24
+
25
+ def test_resources_with_invalid_argument (self ):
26
+ """Check that you can resolve the resources when passing an invalid argument."""
27
+ url = reverse ("resources:index" , kwargs = {"resource_type" : "urinal-cake" })
28
+ response = self .client .get (url )
29
+ self .assertEqual (response .status_code , 404 )
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ start = "python manage.py run --debug"
51
51
makemigrations = " python manage.py makemigrations"
52
52
django_shell = " python manage.py shell"
53
53
test = " coverage run manage.py test"
54
+ coverage = " coverage run manage.py test --no-input; coverage report -m"
54
55
report = " coverage report -m"
55
56
lint = " pre-commit run --all-files"
56
57
precommit = " pre-commit install"
You can’t perform that action at this time.
0 commit comments