From 6afd8035bc4b89f5b50320167c23274ebec86355 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Thu, 7 Sep 2017 23:43:34 +0200 Subject: Correction des tests pour utiliser le modèle Year --- tests.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests.py b/tests.py index bb2d97b..1d23620 100644 --- a/tests.py +++ b/tests.py @@ -16,14 +16,17 @@ from django.test import TestCase from django.utils import timezone -from .models import Course, Group, Timetable +from .models import Course, Group, Timetable, Year class CourseTestCase(TestCase): def setUp(self): dt = timezone.now() - self.timetable = Timetable(name="Test timetable 2", url="http://example.org/", slug="test-timetable2") + self.year = Year(name="L2", slug="l2") + self.year.save() + + self.timetable = Timetable(year=self.year, name="Test timetable 2", url="http://example.org/", slug="test-timetable2") self.timetable.save() cma = Group.objects.create(celcat_name="L1 info s2 CMA", timetable=self.timetable) @@ -53,7 +56,10 @@ class CourseTestCase(TestCase): class GroupTestCase(TestCase): def setUp(self): - self.timetable = Timetable(name="Test timetable", url="http://example.com/", slug="test-timetable") + self.year = Year(name="L1", slug="l1") + self.year.save() + + self.timetable = Timetable(year=self.year, name="Test timetable", url="http://example.com/", slug="test-timetable") self.timetable.save() Group.objects.create(celcat_name="L1 info s2 CMA", timetable=self.timetable) -- cgit v1.2.1