From 888f1803214a4dd372b37acc022bb7be6ae55217 Mon Sep 17 00:00:00 2001 From: Arnaud-D <35631001+Arnaud-D@users.noreply.github.com> Date: Sun, 15 Sep 2024 23:04:36 +0200 Subject: [PATCH] Corrige 'test_import_in_existing_content' --- .../tests/tests_views/tests_content.py | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/zds/tutorialv2/tests/tests_views/tests_content.py b/zds/tutorialv2/tests/tests_views/tests_content.py index d20b0bb2a1..6dbdea6192 100644 --- a/zds/tutorialv2/tests/tests_views/tests_content.py +++ b/zds/tutorialv2/tests/tests_views/tests_content.py @@ -1222,15 +1222,7 @@ def test_import_in_existing_content(self): # create a tutorial result = self.client.post( reverse("content:create-content", kwargs={"created_content_type": "TUTORIAL"}), - { - "title": given_title, - "description": some_text, - "introduction": some_text, - "conclusion": some_text, - "type": "TUTORIAL", - "licence": self.licence.pk, - "subcategory": self.subcategory.pk, - }, + {"title": given_title, "type": "TUTORIAL"}, follow=False, ) self.assertEqual(result.status_code, 302) @@ -1240,6 +1232,20 @@ def test_import_in_existing_content(self): tuto_pk = tuto.pk tuto_slug = tuto.slug + result = self.client.post( + reverse("content:edit-introduction", args=[tuto.pk]), + {"introduction": some_text}, + follow=False, + ) + self.assertEqual(result.status_code, 302) + + result = self.client.post( + reverse("content:edit-conclusion", args=[tuto.pk]), + {"conclusion": some_text}, + follow=False, + ) + self.assertEqual(result.status_code, 302) + # add a chapter result = self.client.post( reverse("content:create-container", args=[tuto_pk, tuto_slug]),