aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2021-06-08 00:26:40 +0200
committerGravatar Johannes Christ <[email protected]>2021-06-08 00:29:59 +0200
commitc998d475440cf4819bad7ebc3ed19f31ce82baf4 (patch)
treebfdeba9a483ebb7646171c79f5b259c27f3d17dd /pydis_site/apps/resources
parentFix `content` app tests not running on macOS (#519) (diff)
Move subdomains to query paths.
In more detail: - Use Django URL namespaces (e.g. `api:bot:infractions`) instead of `django_hosts` host argument. - Update the hosts file setup documentation to remove subdomain entries. - Update the hosts file setup documentation to mention that the entry of `pythondiscord.local` is not required and mainly for convenience. - Rename the `APISubdomainTestCase` to the more fitting `AuthenticatedAPITestCase`, as authentication is all that is left that the class is doing. - Drop dependency to `django_hosts`.
Diffstat (limited to 'pydis_site/apps/resources')
-rw-r--r--pydis_site/apps/resources/tests/test_views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pydis_site/apps/resources/tests/test_views.py b/pydis_site/apps/resources/tests/test_views.py
index 53685eef..3ad0b958 100644
--- a/pydis_site/apps/resources/tests/test_views.py
+++ b/pydis_site/apps/resources/tests/test_views.py
@@ -3,7 +3,7 @@ from unittest.mock import patch
from django.conf import settings
from django.test import TestCase
-from django_hosts import reverse
+from django.urls import reverse
TESTING_RESOURCES_PATH = Path(
settings.BASE_DIR, "pydis_site", "apps", "resources", "tests", "testing_resources"
@@ -22,13 +22,13 @@ class TestResourcesListView(TestCase):
@patch("pydis_site.apps.resources.views.resources_list.RESOURCES_PATH", TESTING_RESOURCES_PATH)
def test_valid_resource_list_200(self):
"""Check does site return code 200 when visiting valid resource list."""
- url = reverse("resources:resources", ("testing",))
+ url = reverse("resources:resources", args=("testing",))
response = self.client.get(url)
self.assertEqual(response.status_code, 200)
@patch("pydis_site.apps.resources.views.resources_list.RESOURCES_PATH", TESTING_RESOURCES_PATH)
def test_invalid_resource_list_404(self):
"""Check does site return code 404 when trying to visit invalid resource list."""
- url = reverse("resources:resources", ("invalid",))
+ url = reverse("resources:resources", args=("invalid",))
response = self.client.get(url)
self.assertEqual(response.status_code, 404)