From acd1f42847786963fc4aaeed884c3091700c9e35 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 17 Nov 2026 21:23:57 +0100 Subject: feat(core): add user account page Add an authenticated user page showing the current username and remote address, including guidance for validating reverse-proxy hop configuration. Allow users to change their own password through a CSRF-protected WTForms form while preserving the active session and invalidating other existing sessions. --- tests/test_init.py | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'tests/test_init.py') diff --git a/tests/test_init.py b/tests/test_init.py index cff42f9..8f2bbb7 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -56,7 +56,9 @@ def test_in_memory_sqlite_enforces_foreign_keys_without_wal(app: Flask) -> None: with app.app_context(): with db.engine.connect() as connection: assert connection.exec_driver_sql("PRAGMA foreign_keys").scalar() == 1 - assert connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "memory" + assert ( + connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "memory" + ) def test_file_sqlite_enables_wal_and_foreign_keys(tmp_path: Path) -> None: @@ -69,12 +71,16 @@ def test_file_sqlite_enables_wal_and_foreign_keys(tmp_path: Path) -> None: try: with db.engine.connect() as connection: assert connection.exec_driver_sql("PRAGMA foreign_keys").scalar() == 1 - assert connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "wal" + assert ( + connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "wal" + ) # Foreign-key enforcement must also apply to fresh pooled connections. db.engine.dispose() with db.engine.connect() as connection: assert connection.exec_driver_sql("PRAGMA foreign_keys").scalar() == 1 - assert connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "wal" + assert ( + connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "wal" + ) finally: db.engine.dispose() @@ -89,7 +95,9 @@ def test_sqlite_settings_apply_to_sqlite_binds(tmp_path: Path) -> None: try: with db.engines["archive"].connect() as connection: assert connection.exec_driver_sql("PRAGMA foreign_keys").scalar() == 1 - assert connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "wal" + assert ( + connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "wal" + ) finally: db.engines["archive"].dispose() db.engine.dispose() @@ -161,9 +169,15 @@ def test_in_memory_sqlite_skips_file_only_pragmas(tmp_path: Path) -> None: with app.app_context(): try: with db.engine.connect() as connection: - assert connection.exec_driver_sql("PRAGMA journal_mode").scalar() == "memory" + assert ( + connection.exec_driver_sql("PRAGMA journal_mode").scalar() + == "memory" + ) assert connection.exec_driver_sql("PRAGMA cache_size").scalar() == -4096 - assert connection.exec_driver_sql("PRAGMA wal_autocheckpoint").scalar() == 1000 + assert ( + connection.exec_driver_sql("PRAGMA wal_autocheckpoint").scalar() + == 1000 + ) finally: db.engine.dispose() @@ -178,7 +192,9 @@ def test_sqlite_pragma_settings_also_apply_to_binds(tmp_path: Path) -> None: with app.app_context(): try: with db.engines["archive"].connect() as connection: - assert connection.exec_driver_sql("PRAGMA busy_timeout").scalar() == 1234 + assert ( + connection.exec_driver_sql("PRAGMA busy_timeout").scalar() == 1234 + ) assert connection.exec_driver_sql("PRAGMA cache_size").scalar() == -2048 finally: db.engines["archive"].dispose() -- cgit v1.3.1