mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-04-03 16:51:26 +00:00
1.6 KiB
1.6 KiB
applyTo
| applyTo |
|---|
| ** |
Lancer les tests – N3WT-SCHOOL
Tests backend (Django)
Les tests backend tournent dans le conteneur Docker. Toujours utiliser --settings=N3wtSchool.test_settings.
# Tous les tests
docker exec -it n3wt-school-backend-1 python3 manage.py test --settings=N3wtSchool.test_settings --verbosity=2
# Un module spécifique
docker exec -it n3wt-school-backend-1 python3 manage.py test --settings=N3wtSchool.test_settings Auth.tests --verbosity=2
Points importants
- Le fichier
Back-End/N3wtSchool/test_settings.pyconfigure l'environnement de test :- Base PostgreSQL dédiée
school_test(SQLite incompatible avecArrayField) - Cache en mémoire locale (pas de Redis)
- Channels en mémoire (
InMemoryChannelLayer) - Throttling désactivé
- Hashage MD5 (plus rapide)
- Email en mode
locmem
- Base PostgreSQL dédiée
- Si le conteneur n'est pas démarré :
docker compose up -ddepuis la racine du projet - Les logs
WARNINGdans la sortie des tests sont normaux (endpoints qui retournent 400/401 intentionnellement)
Tests frontend (Jest)
# Depuis le dossier Front-End
cd Front-End
npm test -- --watchAll=false
# Avec couverture
npm test -- --watchAll=false --coverage
Points importants
- Les tests sont dans
Front-End/src/test/ - Les warnings
ReactDOMTestUtils.act is deprecatedsont non bloquants (dépendance@testing-library/react) - Config Jest :
Front-End/jest.config.js
Résultats attendus
| Périmètre | Nb tests | Statut |
|---|---|---|
| Backend Django | 121 | ✅ OK |
| Frontend Jest | 24 | ✅ OK |