This commit is contained in:
Gilles Soulier
2026-01-14 21:54:55 +01:00
parent c91c0f1fc9
commit d0b73b9319
140 changed files with 5822 additions and 161 deletions

7
tests/db/test_models.py Executable file → Normal file
View File

@@ -2,7 +2,7 @@
Tests pour les modeles SQLAlchemy.
"""
from datetime import datetime
from datetime import datetime, timezone
import pytest
from sqlalchemy import create_engine
@@ -30,6 +30,7 @@ def session() -> Session:
yield session
finally:
session.close()
engine.dispose()
def test_product_relationships(session: Session):
@@ -42,7 +43,7 @@ def test_product_relationships(session: Session):
stock_status="in_stock",
fetch_method="http",
fetch_status="success",
fetched_at=datetime.utcnow(),
fetched_at=datetime.now(timezone.utc),
)
image = ProductImage(image_url="https://example.com/image.jpg", position=0)
spec = ProductSpec(spec_key="Couleur", spec_value="Noir")
@@ -52,7 +53,7 @@ def test_product_relationships(session: Session):
reference="B08N5WRWNW",
fetch_method="http",
fetch_status="success",
fetched_at=datetime.utcnow(),
fetched_at=datetime.now(timezone.utc),
duration_ms=1200,
html_size_bytes=2048,
errors={"items": []},