"""
Tests de sécurité - Sanitization des entrées utilisateur.
Ces tests vérifient:
- Protection contre XSS
- Protection contre l'injection
- Gestion des entrées malveillantes
"""
import pytest
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
from utils.preprocessing import preprocess_product_text, validate_text_input
# =============================================================================
# TESTS XSS Prevention
# =============================================================================
@pytest.mark.security
class TestXSSPrevention:
"""Tests de prévention XSS."""
XSS_PAYLOADS = [
# Script tags
"",
"",
"",
# Event handlers
"",
"
",
"