diff options
author | Alban Gruin | 2018-09-06 21:46:51 +0200 |
---|---|---|
committer | Alban Gruin | 2018-09-06 21:46:51 +0200 |
commit | 676345434415d40363c80960484abf0295ca800a (patch) | |
tree | 76c0f71fd86f19962812a63da109bf79ebd2d43c /tests.py | |
parent | 6b8ea6615de6000ea14396fc2d31eb5c6cb159f9 (diff) | |
parent | b4fde18263de491650c71bd31dffe3c324e97879 (diff) |
Merge branch 'stable/0.14.z' into prod/pa1ch/0.y.zv0.14.0-pa1chprod/pa1ch/0.y.z
Diffstat (limited to 'tests.py')
-rw-r--r-- | tests.py | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -113,6 +113,11 @@ class GroupTestCase(TestCase): Group.objects.create(celcat_name="M1 CHI-TCCM (EM) s2 TPA12", source=self.source) + # Cas spécial avec un nombre supplémentaire dans le nom de groupe + Group.objects.create(celcat_name="L1 4L s1 CM4L", source=self.source) + Group.objects.create(celcat_name="L1 4L s1 TD4L1", source=self.source) + Group.objects.create(celcat_name="L1 4L s1 TP4L12", source=self.source) + def test_corresponds(self): cma = Group.objects.get(celcat_name="L1 info s2 CMA", source=self.source) @@ -178,6 +183,22 @@ class GroupTestCase(TestCase): self.assertTrue(ga111.corresponds_to(*general.group_info)) self.assertFalse(general.corresponds_to(*ga111.group_info)) + def test_corresponds_number(self): + cm4l = Group.objects.get(celcat_name="L1 4L s1 CM4L", + source=self.source) + td4l1 = Group.objects.get(celcat_name="L1 4L s1 TD4L1", + source=self.source) + tp4l12 = Group.objects.get(celcat_name="L1 4L s1 TP4L12", + source=self.source) + + self.assertFalse(cm4l.corresponds_to(*td4l1.group_info)) + self.assertFalse(cm4l.corresponds_to(*tp4l12.group_info)) + self.assertFalse(td4l1.corresponds_to(*tp4l12.group_info)) + + self.assertTrue(td4l1.corresponds_to(*cm4l.group_info)) + self.assertTrue(tp4l12.corresponds_to(*cm4l.group_info)) + self.assertTrue(tp4l12.corresponds_to(*td4l1.group_info)) + def test_correspond_parenthesis(self): general = Group.objects.get(celcat_name="M1 CHI-TCCM (EM) (toutes" " sections et semestres confondus)") @@ -246,6 +267,18 @@ class GroupTestCase(TestCase): self.assertEqual(general.group_info, ("M1 GC", None, "")) self.assertEqual(ga111.group_info, ("M1 GC", 2, "A111")) + def test_parse_number(self): + cm4l = Group.objects.get(celcat_name="L1 4L s1 CM4L", + source=self.source) + td4l1 = Group.objects.get(celcat_name="L1 4L s1 TD4L1", + source=self.source) + tp4l12 = Group.objects.get(celcat_name="L1 4L s1 TP4L12", + source=self.source) + + self.assertEqual(cm4l.group_info, ("L1 4L", 1, "4L")) + self.assertEqual(td4l1.group_info, ("L1 4L", 1, "4L1")) + self.assertEqual(tp4l12.group_info, ("L1 4L", 1, "4L12")) + def test_parse_parenthesis(self): general = Group.objects.get(celcat_name="M1 CHI-TCCM (EM) (toutes" " sections et semestres confondus)") |