fix: resolve Google login hydration mismatch and dynamic env load
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s

This commit is contained in:
2026-06-07 12:21:06 +02:00
parent 5b8c29dae6
commit feea02033b
6 changed files with 127 additions and 7 deletions

23
tests/test_google_auth.py Normal file
View File

@@ -0,0 +1,23 @@
import pytest
import services.auth_service as auth_svc
from services.auth_service import get_or_create_google_user
def test_google_user_creation(monkeypatch):
# Enable database for testing
monkeypatch.setattr(auth_svc, "USE_DATABASE", True)
monkeypatch.setattr(auth_svc, "DATABASE_AVAILABLE", True)
email = "google_test_user@example.com"
name = "Google User"
avatar_url = "https://example.com/avatar.png"
# Create the user
user = get_or_create_google_user(email=email, name=name, avatar_url=avatar_url)
assert user is not None
assert user.email == email
assert user.name == name
assert user.avatar_url == avatar_url
# Retrieve again
user_again = get_or_create_google_user(email=email, name=name, avatar_url="https://new-avatar.com")
assert user_again.id == user.id