aboutsummaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
authorAlban Gruin2018-02-10 19:44:01 +0100
committerAlban Gruin2018-02-10 19:44:01 +0100
commit3f88825de1e13ec44822a00589cf9a5913d0a1cd (patch)
treec048505543f8f2218e3252e6c68353688dc031c9 /tests.py
parentabaa63de655d8d0a0c62224c7cca9318f39d436f (diff)
Ajout de cas de tests de groupes avec des parenthèses dans le nom
Diffstat (limited to 'tests.py')
-rw-r--r--tests.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests.py b/tests.py
index bd289cc..c3d34fd 100644
--- a/tests.py
+++ b/tests.py
@@ -107,6 +107,12 @@ class GroupTestCase(TestCase):
# Doit appartenir au groupe au-dessus.
Group.objects.create(celcat_name="M1 GC s2 GA111", source=self.source)
+ # Cas spécial avec les parenthèses
+ Group.objects.create(celcat_name="M1 CHI-TCCM (EM) (toutes sections et"
+ " semestres confondus)", source=self.source)
+ Group.objects.create(celcat_name="M1 CHI-TCCM (EM) s2 TPA12",
+ source=self.source)
+
def test_corresponds(self):
cma = Group.objects.get(celcat_name="L1 info s2 CMA",
source=self.source)
@@ -172,6 +178,14 @@ class GroupTestCase(TestCase):
self.assertTrue(ga111.corresponds_to(*general.group_info))
self.assertFalse(general.corresponds_to(*ga111.group_info))
+ def test_correspond_parenthesis(self):
+ general = Group.objects.get(celcat_name="M1 CHI-TCCM (EM) (toutes"
+ " sections et semestres confondus)")
+ a12 = Group.objects.get(celcat_name="M1 CHI-TCCM (EM) s2 TPA12")
+
+ self.assertTrue(a12.corresponds_to(*general.group_info))
+ self.assertFalse(general.corresponds_to(*a12.group_info))
+
def test_get(self):
cma = Group.objects.get(name="L1 info s2 CMA", source=self.source)
tda2 = Group.objects.get(name="L1 info s2 TDA2", source=self.source)
@@ -232,6 +246,14 @@ class GroupTestCase(TestCase):
self.assertEqual(general.group_info, ("M1 GC", None, ""))
self.assertEqual(ga111.group_info, ("M1 GC", 2, "A111"))
+ def test_parse_parenthesis(self):
+ general = Group.objects.get(celcat_name="M1 CHI-TCCM (EM) (toutes"
+ " sections et semestres confondus)")
+ a12 = Group.objects.get(celcat_name="M1 CHI-TCCM (EM) s2 TPA12")
+
+ self.assertEqual(general.group_info, ("M1 CHI-TCCM (EM)", None, ""))
+ self.assertEqual(a12.group_info, ("M1 CHI-TCCM (EM)", 2, "A12"))
+
class RoomTestCase(TestCase):
def setUp(self):