feat(mail): restauration de l'envoie de mail
All checks were successful
Build and Publish Docker Images / Build Frontend Image (push) Successful in 2m56s
Build and Publish Docker Images / Build Backend Image (push) Successful in 3m5s
Build and Publish Docker Images / Build Summary (push) Successful in 3s

This commit is contained in:
2025-12-04 06:04:13 +01:00
parent 08c8ee4931
commit f76b033d55
11 changed files with 1189 additions and 184 deletions

View File

@@ -292,9 +292,15 @@ class TestGenerateReportHTML:
'elements': [
{
'label': 'Q1',
'description': '',
'skill': '',
'domain': '',
'raw_value': '4',
'calculated_score': 4.0,
'max_points': 5.0,
'grading_type': 'notes',
'score_label': '',
'max_points': 5.0
'comment': ''
}
]
}
@@ -329,10 +335,11 @@ class TestGenerateReportHTML:
assert '75' in html # percentage
def test_generate_html_contains_statistics(self, sample_report_data):
"""Le HTML contient les statistiques."""
"""Le HTML ne contient plus les statistiques de classe (supprimées)."""
html = generate_report_html(sample_report_data)
assert '12.5' in html # mean
assert '13.0' in html or '13' in html # median
# Les statistiques de classe ont été supprimées du template
assert 'Statistiques de la classe' not in html
assert 'Position :' not in html
def test_generate_html_with_message(self, sample_report_data):
"""Le HTML inclut le message personnalisé."""
@@ -340,8 +347,8 @@ class TestGenerateReportHTML:
html = generate_report_html(sample_report_data, message)
assert message in html
def test_generate_html_color_code_green(self):
"""Couleur verte pour les bons scores (>= 80%)."""
def test_generate_html_no_dynamic_color(self):
"""Le HTML n'a plus de couleur dynamique basée sur le score."""
report_data = {
'assessment': {'title': 'Test', 'date': '2025-01-01', 'trimester': 1, 'class_name': 'Test', 'coefficient': 1},
'student': {'full_name': 'Test', 'first_name': 'Test', 'last_name': 'Test', 'email': 'test@test.com'},
@@ -352,18 +359,9 @@ class TestGenerateReportHTML:
'class_statistics': {'count': 10, 'mean': 12, 'median': 12, 'min': 5, 'max': 18, 'std_dev': 2}
}
html = generate_report_html(report_data)
assert '#22c55e' in html # green
def test_generate_html_color_code_red(self):
"""Couleur rouge pour les mauvais scores (< 40%)."""
report_data = {
'assessment': {'title': 'Test', 'date': '2025-01-01', 'trimester': 1, 'class_name': 'Test', 'coefficient': 1},
'student': {'full_name': 'Test', 'first_name': 'Test', 'last_name': 'Test', 'email': 'test@test.com'},
'results': {'total_score': 5, 'total_max_points': 20, 'percentage': 25.0, 'position': 10, 'total_students': 10},
'exercises': [],
'competences': [],
'domains': [],
'class_statistics': {'count': 10, 'mean': 12, 'median': 12, 'min': 5, 'max': 18, 'std_dev': 2}
}
html = generate_report_html(report_data)
assert '#ef4444' in html # red
# Les couleurs dynamiques (vert/jaune/rouge) ont été supprimées
assert '#22c55e' not in html # pas de vert
assert '#f6d32d' not in html # pas de jaune
assert '#ef4444' not in html # pas de rouge
# Le score utilise maintenant une couleur neutre
assert 'background-color: #f3f4f6' in html # gris neutre