diff options
author | Alban Gruin | 2017-09-07 23:43:34 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-07 23:43:34 +0200 |
commit | 6afd8035bc4b89f5b50320167c23274ebec86355 (patch) | |
tree | 57011fe0820706d3a01c84a9cc09ea5ed0157331 /tests.py | |
parent | 6e89b67eefe3c230aa59ce55c403b7b4932ec50c (diff) |
Correction des tests pour utiliser le modèle Year
Diffstat (limited to 'tests.py')
-rw-r--r-- | tests.py | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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) |