from app.models.user import UserProfile
from app.repositories.user import UserRepository


async def test_create_user_profile(session):
    repo = UserRepository(session)
    user = UserProfile(
        keycloak_sub="sub-123",
        email="user@example.com",
        username="user1",
    )
    await repo.add(user)
    await session.commit()
    found = await repo.get_by_sub("sub-123")
    assert found is not None
    assert found.email == "user@example.com"
