mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Fix further problems with middleware ordering
This commit is contained in:
@@ -189,3 +189,11 @@ def test_metrics_view(monkeypatch, client):
|
||||
# test metrics-view
|
||||
basic_auth = {"HTTP_AUTHORIZATION": base64.b64encode(bytes("foo:bar", "utf-8"))}
|
||||
assert "{} {}".format(fullname, counter_value) not in client.get("/metrics", headers=basic_auth)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@override_settings(HAS_REDIS=True, METRICS_USER="foo", METRICS_PASSPHRASE="bar")
|
||||
def test_do_not_break_append_slash(monkeypatch, client):
|
||||
r = client.get('/control')
|
||||
assert r.status_code == 301
|
||||
assert r['Location'] == '/control/'
|
||||
|
||||
@@ -27,6 +27,13 @@ def test_control_only_on_main_domain(env, client):
|
||||
assert r['Location'] == 'http://example.com/control/login'
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_append_slash(env, client):
|
||||
r = client.get('/control')
|
||||
assert r.status_code == 301
|
||||
assert r['Location'] == '/control/'
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_unknown_domain(env, client):
|
||||
r = client.get('/control/login', HTTP_HOST='foobar')
|
||||
|
||||
Reference in New Issue
Block a user