feat: Add unique constraint on sound hash and update related tests

This commit is contained in:
JSC
2025-07-30 21:43:27 +02:00
parent e43650c26c
commit 974fb05087
5 changed files with 33 additions and 20 deletions

View File

@@ -18,7 +18,7 @@ class TestUserOauthRepository:
async def user_oauth_repository(
self,
test_session: AsyncSession,
) -> AsyncGenerator[UserOauthRepository, None]: # type: ignore[misc]
) -> AsyncGenerator[UserOauthRepository, None]:
"""Create a user OAuth repository instance."""
yield UserOauthRepository(test_session)
@@ -28,6 +28,7 @@ class TestUserOauthRepository:
test_user: User,
) -> int:
"""Get test user ID to avoid lazy loading issues."""
assert test_user.id is not None
return test_user.id
@pytest_asyncio.fixture
@@ -35,7 +36,7 @@ class TestUserOauthRepository:
self,
test_session: AsyncSession,
test_user_id: int,
) -> AsyncGenerator[UserOauth, None]: # type: ignore[misc]
) -> AsyncGenerator[UserOauth, None]:
"""Create a test OAuth record."""
oauth_data = {
"user_id": test_user_id,