Modification label PDF candidat

This commit is contained in:
Claude Paroz 2022-12-22 13:55:27 +01:00
parent a6e22bac79
commit dc74c24f65
2 changed files with 10 additions and 2 deletions

View file

@ -102,11 +102,11 @@ class InscriptionSummaryPDF(EpcBaseDocTemplate):
])
elif candidate.diploma == 4: # Portfolio
work_label = candidate._meta.get_field('work_certificate').verbose_name
data.extend([
["Certif. de travail/stage de 400h. dans n'importe quel domaine",
candidate.get_ok('certif_of_400_general')],
["Bilan de l'activité professionnelle",
candidate.get_ok('work_certificate')],
[work_label, candidate.get_ok('work_certificate')],
])
if candidate.option != 'PS':

View file

@ -1,4 +1,5 @@
from datetime import date, datetime
from io import BytesIO
from unittest import mock
from django.contrib.auth.models import User
@ -9,6 +10,7 @@ from django.urls import reverse
from stages.views.export import openxml_contenttype
from stages.models import Section, Teacher
from .models import Candidate, Interview
from .pdf import InscriptionSummaryPDF
class CandidateTests(TestCase):
@ -369,6 +371,12 @@ tél. 032 886 33 00
)
self.assertEqual(response['Content-Type'], 'application/pdf')
self.assertGreater(int(response['Content-Length']), 1000)
# Test PDF pour chaque type de diplôme
buff = BytesIO()
for dipl_value in (0, 1, 2, 3, 4):
pdf = InscriptionSummaryPDF(buff)
cand.diploma = dipl_value
pdf.produce(cand)
def test_export_candidates(self):
ede = Section.objects.create(name='EDE')