forked from CGM_Public/pretix_original
Fix test suite failures
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user