refactor: Rename global current playlist methods for clarity and consistency

This commit is contained in:
JSC
2025-08-01 17:12:56 +02:00
parent c0f51b2e23
commit 0575d12b0e
6 changed files with 33 additions and 104 deletions

View File

@@ -222,28 +222,11 @@ class TestPlaylistRepository:
test_session: AsyncSession,
ensure_plans: Any,
) -> None:
"""Test getting current playlist when none is set."""
# Create test user within this test
user = User(
email="test2@example.com",
name="Test User 2",
password_hash=PasswordUtils.hash_password("password123"),
role="user",
is_active=True,
plan_id=ensure_plans[0].id,
credits=100,
)
test_session.add(user)
await test_session.commit()
await test_session.refresh(user)
"""Test getting current playlist when none is set globally."""
# Test the repository method - should return None when no current playlist is set globally
playlist = await playlist_repository.get_current_playlist()
# Extract user ID immediately after refresh
user_id = user.id
# Test the repository method - should return None when no current playlist
playlist = await playlist_repository.get_current_playlist(user_id)
# Should return None since no user playlist is marked as current
# Should return None since no playlist is marked as current globally
assert playlist is None
@pytest.mark.asyncio