diff --git a/src/pretix/base/middleware.py b/src/pretix/base/middleware.py index 0401a1477e..f300e72f36 100644 --- a/src/pretix/base/middleware.py +++ b/src/pretix/base/middleware.py @@ -3,7 +3,7 @@ from urllib.parse import urlsplit import pytz from django.conf import settings -from django.http import HttpRequest, HttpResponse, Http404 +from django.http import Http404, HttpRequest, HttpResponse from django.middleware.common import CommonMiddleware from django.urls import get_script_prefix from django.utils import timezone, translation diff --git a/src/tests/api/test_idempotency.py b/src/tests/api/test_idempotency.py index 32d0a927c8..c92545d5d0 100644 --- a/src/tests/api/test_idempotency.py +++ b/src/tests/api/test_idempotency.py @@ -115,9 +115,9 @@ def test_ignore_outside_api(token_client, organizer): resp = token_client.post('/control/login'.format(organizer.slug), PAYLOAD, format='json', HTTP_X_IDEMPOTENCY_KEY='foo') assert resp.status_code == 200 - resp = token_client.post('/control/invalid'.format(organizer.slug), + resp = token_client.post('/control/invalid/'.format(organizer.slug), PAYLOAD, format='json', HTTP_X_IDEMPOTENCY_KEY='foo') - assert resp.status_code == 301 + assert resp.status_code == 302 @pytest.fixture diff --git a/src/tests/control/test_auth.py b/src/tests/control/test_auth.py index b2daaa8186..6fd87963eb 100644 --- a/src/tests/control/test_auth.py +++ b/src/tests/control/test_auth.py @@ -783,7 +783,7 @@ def test_impersonate(user, client): response = client.get('/control/global/settings/') assert response.status_code == 403 response = client.get('/control/') - response = client.post('/control/users/impersonate/stop', follow=True) + response = client.post('/control/users/impersonate/stop/', follow=True) assert b'dummy@' in response.content assert b'dummy2@' not in response.content response = client.get('/control/global/settings/') @@ -825,7 +825,8 @@ def test_staff_session(user, client): assert response['Location'] == '/control/' response = client.get('/control/global/settings/') assert response.status_code == 200 - client.post('/control/sudo/stop', follow=True) + response = client.get('/control/sudo/stop/', follow=True) + assert response.status_code == 200 response = client.get('/control/global/settings/') assert response.status_code == 302 assert user.staffsession_set.last().logs.filter(url='/control/global/settings/').exists()