diff --git a/tests/conftest.py b/tests/conftest.py index 5a9eb61..ec017ac 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,8 +21,11 @@ from app.main import app @pytest.fixture(autouse=True) async def reset_db() -> None: + await engine.dispose() + test_db_path = PROJECT_ROOT / "test.db" + if test_db_path.exists(): + test_db_path.unlink() async with engine.begin() as conn: - await conn.run_sync(Base.metadata.drop_all) await conn.run_sync(Base.metadata.create_all) yield diff --git a/tests/test_auth_flow.py b/tests/test_auth_flow.py index fb80026..f69ecf1 100644 --- a/tests/test_auth_flow.py +++ b/tests/test_auth_flow.py @@ -6,6 +6,7 @@ from app.auth.models import EmailVerificationToken async def test_register_verify_login_and_me(client, db_session): register_payload = { "email": "alice@example.com", + "name": "Alice", "username": "alice", "password": "strongpass123", } @@ -46,6 +47,7 @@ async def test_register_verify_login_and_me(client, db_session): async def test_refresh_token_rotation(client, db_session): payload = { "email": "bob@example.com", + "name": "Bob", "username": "bob", "password": "strongpass123", } diff --git a/tests/test_chat_message_flow.py b/tests/test_chat_message_flow.py index 4079cfc..dc54786 100644 --- a/tests/test_chat_message_flow.py +++ b/tests/test_chat_message_flow.py @@ -7,7 +7,7 @@ from app.chats.models import ChatType async def _create_verified_user(client, db_session, email: str, username: str, password: str) -> dict: await client.post( "/api/v1/auth/register", - json={"email": email, "username": username, "password": password}, + json={"email": email, "name": username, "username": username, "password": password}, ) token_row = await db_session.execute(select(EmailVerificationToken).order_by(EmailVerificationToken.id.desc())) verify_token = token_row.scalar_one().token diff --git a/web/src/components/SettingsPanel.tsx b/web/src/components/SettingsPanel.tsx index 25d8d67..457fde2 100644 --- a/web/src/components/SettingsPanel.tsx +++ b/web/src/components/SettingsPanel.tsx @@ -357,23 +357,6 @@ export function SettingsPanel({ open, onClose }: Props) { {savingPrivacy ? "Saving..." : "Save privacy settings"} -
- { - setAllowPrivateMessages(checked); - setSavingPrivacy(true); - try { - const updated = await updateMyProfile({ allow_private_messages: checked }); - useAuthStore.setState({ me: updated as AuthUser }); - } finally { - setSavingPrivacy(false); - } - }} - disabled={savingPrivacy} - /> -

Two-Factor Authentication