update tests for relative redirects
This commit is contained in:
parent
ce7b884b73
commit
81c7ff7f8d
6 changed files with 20 additions and 9 deletions
|
|
@ -11,7 +11,7 @@ def test_register(client, app):
|
|||
|
||||
# test that successful registration redirects to the login page
|
||||
response = client.post("/auth/register", data={"username": "a", "password": "a"})
|
||||
assert "http://localhost/auth/login" == response.headers["Location"]
|
||||
assert response.headers["Location"] == "/auth/login"
|
||||
|
||||
# test that the user was inserted into the database
|
||||
with app.app_context():
|
||||
|
|
@ -42,7 +42,7 @@ def test_login(client, auth):
|
|||
|
||||
# test that successful login redirects to the index page
|
||||
response = auth.login()
|
||||
assert response.headers["Location"] == "http://localhost/"
|
||||
assert response.headers["Location"] == "/"
|
||||
|
||||
# login request set the user_id in the session
|
||||
# check that the user is loaded from the session
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue