mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
feat: Création de tests unitaires pour le back[#63]
This commit is contained in:
27
Back-End/Planning/tests.py
Normal file
27
Back-End/Planning/tests.py
Normal file
@ -0,0 +1,27 @@
|
||||
from django.test import TestCase
|
||||
from .models import Planning
|
||||
from Establishment.models import Establishment
|
||||
from School.models import SchoolClass
|
||||
|
||||
class PlanningModelTest(TestCase):
|
||||
def setUp(self):
|
||||
self.establishment = Establishment.objects.create(
|
||||
name="École Test",
|
||||
address="1 rue de l'École",
|
||||
total_capacity=100,
|
||||
establishment_type=[1],
|
||||
evaluation_frequency=1,
|
||||
licence_code="ABC123"
|
||||
)
|
||||
self.school_class = SchoolClass.objects.create(
|
||||
atmosphere_name="Classe Test",
|
||||
establishment=self.establishment
|
||||
)
|
||||
|
||||
def test_create_planning(self):
|
||||
planning = Planning.objects.create(
|
||||
school_class=self.school_class,
|
||||
establishment=self.establishment
|
||||
)
|
||||
self.assertEqual(planning.school_class, self.school_class)
|
||||
self.assertEqual(planning.establishment, self.establishment)
|
||||
Reference in New Issue
Block a user