aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Gruin2017-09-04 21:49:32 +0200
committerAlban Gruin2017-09-04 21:49:32 +0200
commit87524ee9598673aba562ba25b078e7996870ee6d (patch)
tree29003507dd39375e3f584c8a09e24db5a02871f1
parent828f19bde69dd525f08ad0c0f46e3929d89463b9 (diff)
Correction des tests en accord avec le nouveau style de groupe
-rw-r--r--tests.py76
1 files changed, 38 insertions, 38 deletions
diff --git a/tests.py b/tests.py
index b6b9a70..a3ae55e 100644
--- a/tests.py
+++ b/tests.py
@@ -27,13 +27,13 @@ class CourseTestCase(TestCase):
self.timetable = Timetable(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)
- tda2 = Group.objects.create(celcat_name="L1 info s2 - TDA2", timetable=self.timetable)
- self.tpa21 = Group.objects.create(celcat_name="L1 info s2 - TPA21", timetable=self.timetable)
+ cma = Group.objects.create(celcat_name="L1 info s2 CMA", timetable=self.timetable)
+ tda2 = Group.objects.create(celcat_name="L1 info s2 TDA2", timetable=self.timetable)
+ self.tpa21 = Group.objects.create(celcat_name="L1 info s2 TPA21", timetable=self.timetable)
- cmb = Group.objects.create(celcat_name="L1 info s2 - CMB", timetable=self.timetable)
- tdb2 = Group.objects.create(celcat_name="L1 info s2 - TDB2", timetable=self.timetable)
- self.tpb21 = Group.objects.create(celcat_name="L1 info s2 - TPB21", timetable=self.timetable)
+ cmb = Group.objects.create(celcat_name="L1 info s2 CMB", timetable=self.timetable)
+ tdb2 = Group.objects.create(celcat_name="L1 info s2 TDB2", timetable=self.timetable)
+ self.tpb21 = Group.objects.create(celcat_name="L1 info s2 TPB21", timetable=self.timetable)
for group in (cma, tda2, self.tpa21, cmb, tdb2, self.tpb21,):
course = Course.objects.create(name="{0} course".format(group.name), type="cours", timetable=self.timetable, begin=dt, end=dt)
@@ -43,8 +43,8 @@ class CourseTestCase(TestCase):
tpa21_courses = Course.objects.get_courses_for_group(self.tpa21)
tpb21_courses = Course.objects.get_courses_for_group(self.tpb21)
- tpa21_course_names = ["L1 info s2 - CMA course", "L1 info s2 - TDA2 course", "L1 info s2 - TPA21 course"]
- tpb21_course_names = ["L1 info s2 - CMB course", "L1 info s2 - TDB2 course", "L1 info s2 - TPB21 course"]
+ tpa21_course_names = ["L1 info s2 CMA course", "L1 info s2 TDA2 course", "L1 info s2 TPA21 course"]
+ tpb21_course_names = ["L1 info s2 CMB course", "L1 info s2 TDB2 course", "L1 info s2 TPB21 course"]
for courses, names in ((tpa21_courses, tpa21_course_names,), (tpb21_courses, tpb21_course_names,),):
for course in courses:
@@ -57,22 +57,22 @@ class GroupTestCase(TestCase):
self.timetable = Timetable(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)
- Group.objects.create(celcat_name="L1 info s2 - TDA2", timetable=self.timetable)
- Group.objects.create(celcat_name="L1 info s2 - TPA21", timetable=self.timetable)
+ Group.objects.create(celcat_name="L1 info s2 CMA", timetable=self.timetable)
+ Group.objects.create(celcat_name="L1 info s2 TDA2", timetable=self.timetable)
+ Group.objects.create(celcat_name="L1 info s2 TPA21", timetable=self.timetable)
- Group.objects.create(celcat_name="L1 info s2 - CMB", timetable=self.timetable)
- Group.objects.create(celcat_name="L1 info s2 - TDB2", timetable=self.timetable)
- Group.objects.create(celcat_name="L1 info s2 - TPB21", timetable=self.timetable)
+ Group.objects.create(celcat_name="L1 info s2 CMB", timetable=self.timetable)
+ Group.objects.create(celcat_name="L1 info s2 TDB2", timetable=self.timetable)
+ Group.objects.create(celcat_name="L1 info s2 TPB21", timetable=self.timetable)
def test_corresponds(self):
- cma = Group.objects.get(celcat_name="L1 info s2 - CMA", timetable=self.timetable)
- tda2 = Group.objects.get(celcat_name="L1 info s2 - TDA2", timetable=self.timetable)
- tpa21 = Group.objects.get(celcat_name="L1 info s2 - TPA21", timetable=self.timetable)
+ cma = Group.objects.get(celcat_name="L1 info s2 CMA", timetable=self.timetable)
+ tda2 = Group.objects.get(celcat_name="L1 info s2 TDA2", timetable=self.timetable)
+ tpa21 = Group.objects.get(celcat_name="L1 info s2 TPA21", timetable=self.timetable)
- cmb = Group.objects.get(celcat_name="L1 info s2 - CMB", timetable=self.timetable)
- tdb2 = Group.objects.get(celcat_name="L1 info s2 - TDB2", timetable=self.timetable)
- tpb21 = Group.objects.get(celcat_name="L1 info s2 - TPB21", timetable=self.timetable)
+ cmb = Group.objects.get(celcat_name="L1 info s2 CMB", timetable=self.timetable)
+ tdb2 = Group.objects.get(celcat_name="L1 info s2 TDB2", timetable=self.timetable)
+ tpb21 = Group.objects.get(celcat_name="L1 info s2 TPB21", timetable=self.timetable)
self.assertTrue(cma.corresponds_to(*tda2.group_info)) # CMA corresponds to TDA2
self.assertTrue(cma.corresponds_to(*tpa21.group_info)) # CMA corresponds to TPA21
@@ -99,30 +99,30 @@ class GroupTestCase(TestCase):
self.assertFalse(tpa21.corresponds_to(*tdb2.group_info)) # TPA21 does not corresponds to TDB2
def test_get(self):
- cma = Group.objects.get(name="L1 info s2 - CMA", timetable=self.timetable)
- tda2 = Group.objects.get(name="L1 info s2 - TDA2", timetable=self.timetable)
- tpa21 = Group.objects.get(name="L1 info s2 - TPA21", timetable=self.timetable)
+ cma = Group.objects.get(name="L1 info s2 CMA", timetable=self.timetable)
+ tda2 = Group.objects.get(name="L1 info s2 TDA2", timetable=self.timetable)
+ tpa21 = Group.objects.get(name="L1 info s2 TPA21", timetable=self.timetable)
- cmb = Group.objects.get(name="L1 info s2 - CMB", timetable=self.timetable)
- tdb2 = Group.objects.get(name="L1 info s2 - TDB2", timetable=self.timetable)
- tpb21 = Group.objects.get(name="L1 info s2 - TPB21", timetable=self.timetable)
+ cmb = Group.objects.get(name="L1 info s2 CMB", timetable=self.timetable)
+ tdb2 = Group.objects.get(name="L1 info s2 TDB2", timetable=self.timetable)
+ tpb21 = Group.objects.get(name="L1 info s2 TPB21", timetable=self.timetable)
- self.assertEqual(cma.celcat_name, "L1 info s2 - CMA")
- self.assertEqual(tda2.celcat_name, "L1 info s2 - TDA2")
- self.assertEqual(tpa21.celcat_name, "L1 info s2 - TPA21")
+ self.assertEqual(cma.celcat_name, "L1 info s2 CMA")
+ self.assertEqual(tda2.celcat_name, "L1 info s2 TDA2")
+ self.assertEqual(tpa21.celcat_name, "L1 info s2 TPA21")
- self.assertEqual(cmb.celcat_name, "L1 info s2 - CMB")
- self.assertEqual(tdb2.celcat_name, "L1 info s2 - TDB2")
- self.assertEqual(tpb21.celcat_name, "L1 info s2 - TPB21")
+ self.assertEqual(cmb.celcat_name, "L1 info s2 CMB")
+ self.assertEqual(tdb2.celcat_name, "L1 info s2 TDB2")
+ self.assertEqual(tpb21.celcat_name, "L1 info s2 TPB21")
def test_parse(self):
- cma = Group.objects.get(celcat_name="L1 info s2 - CMA", timetable=self.timetable)
- tda2 = Group.objects.get(celcat_name="L1 info s2 - TDA2", timetable=self.timetable)
- tpa21 = Group.objects.get(celcat_name="L1 info s2 - TPA21", timetable=self.timetable)
+ cma = Group.objects.get(celcat_name="L1 info s2 CMA", timetable=self.timetable)
+ tda2 = Group.objects.get(celcat_name="L1 info s2 TDA2", timetable=self.timetable)
+ tpa21 = Group.objects.get(celcat_name="L1 info s2 TPA21", timetable=self.timetable)
- cmb = Group.objects.get(celcat_name="L1 info s2 - CMB", timetable=self.timetable)
- tdb2 = Group.objects.get(celcat_name="L1 info s2 - TDB2", timetable=self.timetable)
- tpb21 = Group.objects.get(celcat_name="L1 info s2 - TPB21", timetable=self.timetable)
+ cmb = Group.objects.get(celcat_name="L1 info s2 CMB", timetable=self.timetable)
+ tdb2 = Group.objects.get(celcat_name="L1 info s2 TDB2", timetable=self.timetable)
+ tpb21 = Group.objects.get(celcat_name="L1 info s2 TPB21", timetable=self.timetable)
self.assertEqual(cma.group_info, (self.timetable.id, "L1 info s2", "A", None, None))
self.assertEqual(tda2.group_info, (self.timetable.id, "L1 info s2", "A", 2, None))