forked from CTFd/CTFd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Downgrade Werkzeug from 2.1.2 to 2.0.3 to avoid removal errors (CTFd#…
…2384) * Downgrade Werkzeug from 2.1.2 to 2.0.3 to avoid removal errors * Fix warnings from Werkzeug migration from v1 to v2
- Loading branch information
Showing
16 changed files
with
50 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Flask==2.0.3 | ||
Werkzeug==2.1.2 | ||
Werkzeug==2.0.3 | ||
Flask-SQLAlchemy==2.5.1 | ||
Flask-Caching==2.0.2 | ||
Flask-Migrate==2.5.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,9 @@ def test_user_bad_login(): | |
with client.session_transaction() as sess: | ||
assert sess.get("id") is None | ||
r = client.get("/profile") | ||
assert r.location.startswith("/login") # We got redirected to login | ||
assert r.location.startswith( | ||
"http://localhost/login" | ||
) # We got redirected to login | ||
destroy_ctfd(app) | ||
|
||
|
||
|
@@ -130,7 +132,9 @@ def test_user_login(): | |
register_user(app) | ||
client = login_as_user(app) | ||
r = client.get("/profile") | ||
assert r.location is None # We didn't get redirected to login | ||
assert ( | ||
r.location != "http://localhost/login" | ||
) # We didn't get redirected to login | ||
assert r.status_code == 200 | ||
destroy_ctfd(app) | ||
|
||
|
@@ -142,7 +146,9 @@ def test_user_login_with_email(): | |
register_user(app) | ||
client = login_as_user(app, name="[email protected]", password="password") | ||
r = client.get("/profile") | ||
assert r.location is None # We didn't get redirected to login | ||
assert ( | ||
r.location != "http://localhost/login" | ||
) # We didn't get redirected to login | ||
assert r.status_code == 200 | ||
destroy_ctfd(app) | ||
|
||
|
@@ -155,7 +161,7 @@ def test_user_get_logout(): | |
client = login_as_user(app) | ||
client.get("/logout", follow_redirects=True) | ||
r = client.get("/challenges") | ||
assert r.location == "/login?next=%2Fchallenges%3F" | ||
assert r.location == "http://localhost/login?next=%2Fchallenges%3F" | ||
assert r.status_code == 302 | ||
destroy_ctfd(app) | ||
|
||
|
@@ -176,7 +182,7 @@ def test_user_isnt_admin(): | |
"config", | ||
]: | ||
r = client.get("/admin/{}".format(page)) | ||
assert r.location.startswith("/login?next=") | ||
assert r.location.startswith("http://localhost/login?next=") | ||
assert r.status_code == 302 | ||
destroy_ctfd(app) | ||
|
||
|
@@ -296,29 +302,31 @@ def test_user_can_confirm_email(mock_smtp): | |
|
||
client = login_as_user(app, name="user1", password="password") | ||
|
||
r = client.get("/confirm") | ||
r = client.get("http://localhost/confirm") | ||
assert "We've sent a confirmation email" in r.get_data(as_text=True) | ||
|
||
# smtp send message function was called | ||
mock_smtp.return_value.send_message.assert_called() | ||
|
||
with client.session_transaction() as sess: | ||
data = {"nonce": sess.get("nonce")} | ||
r = client.post("/confirm", data=data) | ||
r = client.post("http://localhost/confirm", data=data) | ||
assert "Confirmation email sent to" in r.get_data(as_text=True) | ||
|
||
r = client.get("/challenges") | ||
assert r.location == "/confirm" # We got redirected to /confirm | ||
assert ( | ||
r.location == "http://localhost/confirm" | ||
) # We got redirected to /confirm | ||
|
||
r = client.get("/confirm/" + serialize("[email protected]")) | ||
assert r.location == "/challenges" | ||
r = client.get("http://localhost/confirm/" + serialize("[email protected]")) | ||
assert r.location == "http://localhost/challenges" | ||
|
||
# The team is now verified | ||
user = Users.query.filter_by(email="[email protected]").first() | ||
assert user.verified is True | ||
|
||
r = client.get("/confirm") | ||
assert r.location == "/settings" | ||
r = client.get("http://localhost/confirm") | ||
assert r.location == "http://localhost/settings" | ||
destroy_ctfd(app) | ||
|
||
|
||
|
@@ -454,7 +462,7 @@ def test_registration_code_required(): | |
data["registration_code"] = "secret-sauce" | ||
r = client.post("/register", data=data) | ||
assert r.status_code == 302 | ||
assert r.location.startswith("/challenges") | ||
assert r.location.startswith("http://localhost/challenges") | ||
destroy_ctfd(app) | ||
|
||
|
||
|
@@ -484,5 +492,5 @@ def test_registration_code_allows_numeric(): | |
data["registration_code"] = "1234567890" | ||
r = client.post("/register", data=data) | ||
assert r.status_code == 302 | ||
assert r.location.startswith("/challenges") | ||
assert r.location.startswith("http://localhost/challenges") | ||
destroy_ctfd(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ def test_ctfd_setup_redirect(): | |
with app.test_client() as client: | ||
r = client.get("/users") | ||
assert r.status_code == 302 | ||
assert r.location == "/setup" | ||
assert r.location == "http://localhost/setup" | ||
|
||
# Files in /themes load properly | ||
r = client.get("/themes/core/static/css/main.dev.css") | ||
|
@@ -52,5 +52,5 @@ def test_ctfd_setup_verification(): | |
data["email"] = "[email protected]" | ||
r = client.post("/setup", data=data) | ||
assert r.status_code == 302 | ||
assert r.location == "/" | ||
assert r.location == "http://localhost/" | ||
destroy_ctfd(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters