2 Commits

Author SHA1 Message Date
  Alban Gruin bb71aca4c2 squash! tests: [WIP] on dirait que ça a amélioré des trucs 6 months ago
  Alban Gruin 1cebb24aab fixup! UPS2018: ajout du champ celcat_id 6 months ago
4 changed files with 7 additions and 4 deletions
  1. 1
    1
      models.py
  2. 4
    1
      tests.py
  3. 1
    1
      tests/data/2018/october.html
  4. 1
    1
      tests/data/2018/september.html

+ 1
- 1
models.py View File

@@ -258,7 +258,7 @@ class Course(models.Model):
258 258
     last_update = models.DateTimeField(verbose_name="dernière mise à jour",
259 259
                                        default=timezone.now)
260 260
 
261
-    celcat_id = models.IntegerField(verbose_name="ID Celcat")
261
+    celcat_id = models.IntegerField(verbose_name="ID Celcat", null=True)
262 262
     module = models.ForeignKey(Module, on_delete=models.SET_NULL, null=True)
263 263
 
264 264
     def __str__(self):

+ 4
- 1
tests.py View File

@@ -506,7 +506,7 @@ class UPS2018ParserTestCase(TestCase):
506 506
         for e in events:
507 507
             event = get_event(
508 508
                 {"start": "2018-09-21T10:00:00", "end": "2018-09-21T12:00:00",
509
-                 "text": e["text"]},
509
+                 "text": e["text"], "id": "0", "tag": []},
510 510
                 timezone.make_aware(datetime.datetime(2018, 9, 21)),
511 511
                 timezone.make_aware(datetime.datetime(2018, 9, 1)),
512 512
                 timezone.make_aware(datetime.datetime(2018, 10, 1)),
@@ -592,16 +592,19 @@ class UPS2018ParserTestCase(TestCase):
592 592
                 "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque"
593 593
                 "<br>L3 Info s1 CMA<br>Salle quelconque",
594 594
                 "id": "0",
595
+                "tag": [],
595 596
             }], [{
596 597
                 "start": "2018-09-21T10:00:00", "end": "2018-09-21T12:00:00",
597 598
                 "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque"
598 599
                 "<br>L3 Info s1 CMA<br>Salle quelconque",
599 600
                 "id": "1",
601
+                "tag": [],
600 602
             }, {
601 603
                 "start": "2018-10-22T10:00:00", "end": "2018-10-22T12:00:00",
602 604
                 "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque"
603 605
                 "<br>L3 Info s1 CMA<br>Salle quelconque",
604 606
                 "id": "2",
607
+                "tag": [],
605 608
             }], [], [], [], [], [], [], [], [], []])
606 609
 
607 610
     def test_get_update_date(self):

+ 1
- 1
tests/data/2018/october.html View File

@@ -40,7 +40,7 @@ do_something();
40 40
 <script>
41 41
 function courses() {
42 42
 var v = {};
43
-v.events.list = [{"start": "2018-09-21T10:00:00", "end": "2018-09-21T12:00:00", "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque<br>L3 Info s1 CMA<br>Salle quelconque", "id": "1"}, {"start": "2018-10-22T10:00:00", "end": "2018-10-22T12:00:00", "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque<br>L3 Info s1 CMA<br>Salle quelconque", "id": "2"}];;
43
+v.events.list = [{"start": "2018-09-21T10:00:00", "end": "2018-09-21T12:00:00", "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque<br>L3 Info s1 CMA<br>Salle quelconque", "id": "1", "tag": []}, {"start": "2018-10-22T10:00:00", "end": "2018-10-22T12:00:00", "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque<br>L3 Info s1 CMA<br>Salle quelconque", "id": "2", "tag": []}];;
44 44
 }
45 45
 </script>
46 46
 

+ 1
- 1
tests/data/2018/september.html View File

@@ -41,7 +41,7 @@ alert("something");
41 41
 <script>
42 42
 function courses() {
43 43
 var v = {};
44
-v.events.list = [{"start": "2018-09-21T10:00:00", "end": "2018-09-21T12:00:00", "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque<br>L3 Info s1 CMA<br>Salle quelconque", "id": "0"}];;
44
+v.events.list = [{"start": "2018-09-21T10:00:00", "end": "2018-09-21T12:00:00", "text": "(10:00-12:00)<br>COURS/TD<br>Cours quelconque<br>L3 Info s1 CMA<br>Salle quelconque", "id": "0", "tag": []}];;
45 45
 }
46 46
 </script>
47 47