feat: Création de tests unitaires pour le back[#63]

This commit is contained in:
N3WT DE COMPET
2025-06-05 16:31:07 +02:00
parent 0064b8d35a
commit 5f0866fd15
11 changed files with 291 additions and 1 deletions

View File

@ -0,0 +1,17 @@
from django.test import TestCase
from .models import Establishment, StructureType, EvaluationFrequency
class EstablishmentModelTest(TestCase):
def test_create_establishment(self):
est = Establishment.objects.create(
name="École Test",
address="1 rue de l'École",
total_capacity=100,
establishment_type=[StructureType.PRIMAIRE],
evaluation_frequency=EvaluationFrequency.TRIMESTER,
licence_code="ABC123"
)
self.assertEqual(est.name, "École Test")
self.assertEqual(est.establishment_type, [StructureType.PRIMAIRE])
self.assertTrue(est.is_active)
self.assertIsNotNone(est.created_at)