From 78e34c10e4892a788cc9657c0b4de3da9f4f0f89 Mon Sep 17 00:00:00 2001 From: Arnaud-D <35631001+Arnaud-D@users.noreply.github.com> Date: Thu, 7 Mar 2024 20:34:49 +0100 Subject: [PATCH] Corrige le test `test_history_navigation` --- .../tests/tests_views/tests_content.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/zds/tutorialv2/tests/tests_views/tests_content.py b/zds/tutorialv2/tests/tests_views/tests_content.py index 32a1e1ecd9..cf7e9d31c3 100644 --- a/zds/tutorialv2/tests/tests_views/tests_content.py +++ b/zds/tutorialv2/tests/tests_views/tests_content.py @@ -624,7 +624,6 @@ def test_history_navigation(self): self.client.force_login(self.user_author) tuto = PublishableContent.objects.get(pk=self.tuto.pk) - versioned = tuto.load_version() # check access result = self.client.get(reverse("content:view", args=[tuto.pk, tuto.slug]), follow=False) @@ -656,21 +655,9 @@ def test_history_navigation(self): old_slug_tuto = tuto.slug version_1 = tuto.sha_draft # 'version 1' is the one before any change - new_licence = LicenceFactory() - random = "Pâques, c'est bientôt?" - result = self.client.post( - reverse("content:edit", args=[tuto.pk, tuto.slug]), - { - "title": random, - "description": random, - "introduction": random, - "conclusion": random, - "type": "TUTORIAL", - "licence": new_licence.pk, - "subcategory": self.subcategory.pk, - "last_hash": versioned.compute_hash(), - }, + reverse("content:edit-title", args=[tuto.pk]), + {"title": "Pâques, c'est bientôt?"}, follow=False, ) self.assertEqual(result.status_code, 302) @@ -736,6 +723,7 @@ def test_history_navigation(self): # edit container: old_slug_part = self.part1.slug part1 = tuto.load_version().children[0] + random = "Un, deux, trois, je vais dans les bois" result = self.client.post( reverse( "content:edit-container", kwargs={"pk": tuto.pk, "slug": tuto.slug, "container_slug": self.part1.slug}