Revised the request methods of the routes in the test cases.
This commit is contained in:
parent
606059a547
commit
bf15bcf1f1
@ -70,7 +70,7 @@ class AuthenticationTestCase(TestCase):
|
|||||||
})
|
})
|
||||||
app.test_client_class = Client
|
app.test_client_class = Client
|
||||||
|
|
||||||
@app.route("/login-required-1/auth", endpoint="auth-1")
|
@app.get("/login-required-1/auth", endpoint="auth-1")
|
||||||
@auth.login_required
|
@auth.login_required
|
||||||
def login_required_1() -> str:
|
def login_required_1() -> str:
|
||||||
"""The first dummy view.
|
"""The first dummy view.
|
||||||
@ -79,7 +79,7 @@ class AuthenticationTestCase(TestCase):
|
|||||||
"""
|
"""
|
||||||
return f"Hello, {g.user.username}! #1"
|
return f"Hello, {g.user.username}! #1"
|
||||||
|
|
||||||
@app.route("/login-required-2/auth", endpoint="auth-2")
|
@app.get("/login-required-2/auth", endpoint="auth-2")
|
||||||
@auth.login_required
|
@auth.login_required
|
||||||
def login_required_2() -> str:
|
def login_required_2() -> str:
|
||||||
"""The second dummy view.
|
"""The second dummy view.
|
||||||
|
@ -91,7 +91,7 @@ class FlaskLoginTestCase(TestCase):
|
|||||||
"""
|
"""
|
||||||
return User(user_id) if user_id in user_db else None
|
return User(user_id) if user_id in user_db else None
|
||||||
|
|
||||||
@app.route("/login-required-1/auth", endpoint="auth-1")
|
@app.get("/login-required-1/auth", endpoint="auth-1")
|
||||||
@flask_login.login_required
|
@flask_login.login_required
|
||||||
def login_required_1() -> str:
|
def login_required_1() -> str:
|
||||||
"""The first dummy view.
|
"""The first dummy view.
|
||||||
@ -100,7 +100,7 @@ class FlaskLoginTestCase(TestCase):
|
|||||||
"""
|
"""
|
||||||
return f"Hello, {flask_login.current_user.username}! #1"
|
return f"Hello, {flask_login.current_user.username}! #1"
|
||||||
|
|
||||||
@app.route("/login-required-2/auth", endpoint="auth-2")
|
@app.get("/login-required-2/auth", endpoint="auth-2")
|
||||||
@flask_login.login_required
|
@flask_login.login_required
|
||||||
def login_required_2() -> str:
|
def login_required_2() -> str:
|
||||||
"""The second dummy view.
|
"""The second dummy view.
|
||||||
|
Loading…
Reference in New Issue
Block a user