import pytest

from smoothschedule.identity.users.models import User
from smoothschedule.identity.users.tests.factories import UserFactory


@pytest.fixture(autouse=True)
def _media_storage(settings, tmpdir) -> None:
    settings.MEDIA_ROOT = tmpdir.strpath


@pytest.fixture
def user(db) -> User:
    """
    Fixture for creating a real User instance in the database.

    Use this only for integration tests that require actual database access.
    For unit tests, use create_mock_user() from factories.py instead.
    """
    return UserFactory()
