14 lines
514 B
Python
14 lines
514 B
Python
def test_pages_require_login(client):
|
|
for path in ("/", "/buchungen", "/import", "/planung"):
|
|
r = client.get(path, follow_redirects=False)
|
|
assert r.status_code in (302, 303), path
|
|
assert r.headers["location"] == "/login"
|
|
|
|
|
|
def test_pages_render_after_login(client):
|
|
client.post("/login", data={"username": "admin", "password": "geheim"})
|
|
for path in ("/", "/buchungen"):
|
|
r = client.get(path)
|
|
assert r.status_code == 200
|
|
assert "Finanzberatung" in r.text
|