"""
Input Validation Security Tests.
This module tests input validation across the application to ensure
all user inputs are properly sanitized and validated.
"""
import pytest
from httpx import AsyncClient
from src.server.fastapi_app import app
@pytest.mark.security
class TestInputValidation:
"""Security tests for input validation."""
@pytest.fixture
async def client(self):
"""Create async HTTP client for testing."""
from httpx import ASGITransport
async with AsyncClient(
transport=ASGITransport(app=app), base_url="http://test"
) as ac:
yield ac
@pytest.mark.asyncio
async def test_xss_in_anime_title(self, client):
"""Test XSS protection in anime title input."""
xss_payloads = [
"",
"",
"javascript:alert('XSS')",
"