aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Gruin2017-09-07 23:43:34 +0200
committerAlban Gruin2017-09-07 23:43:34 +0200
commit6afd8035bc4b89f5b50320167c23274ebec86355 (patch)
tree57011fe0820706d3a01c84a9cc09ea5ed0157331
parent6e89b67eefe3c230aa59ce55c403b7b4932ec50c (diff)
Correction des tests pour utiliser le modèle Year
-rw-r--r--tests.py12
1 files 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)