aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/events
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/events
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/events')
-rw-r--r--pydis_site/apps/events/tests/test_views.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pydis_site/apps/events/tests/test_views.py b/pydis_site/apps/events/tests/test_views.py
index 23c9e596..669fbf82 100644
--- a/pydis_site/apps/events/tests/test_views.py
+++ b/pydis_site/apps/events/tests/test_views.py
@@ -2,7 +2,7 @@ from pathlib import Path
from django.conf import settings
from django.test import TestCase, override_settings
-from django_hosts.resolvers import reverse
+from django.urls import reverse
PAGES_PATH = Path(settings.BASE_DIR, "pydis_site", "templates", "events", "test-pages")
@@ -21,8 +21,8 @@ class PageTests(TestCase):
def test_valid_event_page_reponse_200(self):
"""Should return response code 200 when visiting valid event page."""
pages = (
- reverse("events:page", ("my-event",)),
- reverse("events:page", ("my-event/subpage",)),
+ reverse("events:page", args=("my-event",)),
+ reverse("events:page", args=("my-event/subpage",)),
)
for page in pages:
with self.subTest(page=page):
@@ -33,8 +33,8 @@ class PageTests(TestCase):
def test_invalid_event_page_404(self):
"""Should return response code 404 when visiting invalid event page."""
pages = (
- reverse("events:page", ("invalid",)),
- reverse("events:page", ("invalid/invalid",))
+ reverse("events:page", args=("invalid",)),
+ reverse("events:page", args=("invalid/invalid",))
)
for page in pages:
with self.subTest(page=page):