import pytest from app.core.auth import get_password_hash, verify_password, create_access_token from app.schemas.base import UserRole def test_password_hashing(): """Test password hashing and verification.""" password = "testpassword123" hashed = get_password_hash(password) assert hashed != password assert verify_password(password, hashed) is True assert verify_password("wrongpassword", hashed) is False def test_create_access_token(): """Test JWT token creation.""" data = {"sub": "testuser", "user_id": 1, "role": UserRole.ADMIN} token = create_access_token(data, expires_delta=None) assert isinstance(token, str) assert len(token) > 0