Revised the FlaskLoginTestCase test case and README.rst for illustrations on how to retrieve the currently logged-in user.

This commit is contained in:
imacat committed 2022-11-26 18:59:17 +11:00
1 parent 6f49a180e3
commit cb3e313e21
2 files changed
+14 -9

No files matched your search

+2 -2
View File
@@ -110,7 +110,7 @@ class FlaskLoginTestCase(TestCase):
:return: The response.
"""
return f"Hello, {flask_login.current_user.username}! #1"
return f"Hello, {flask_login.current_user.get_id()}! #1"
@app.get("/admin-2/auth", endpoint="admin-2")
@flask_login.login_required
@@ -119,7 +119,7 @@ class FlaskLoginTestCase(TestCase):
:return: The response.
"""
return f"Hello, {flask_login.current_user.username}! #2"
return f"Hello, {flask_login.current_user.get_id()}! #2"
@app.post("/logout", endpoint="logout")
@flask_login.login_required