Skip to content

Commit

Permalink
Corrige le test test_history_navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud-D committed Mar 8, 2024
1 parent 6da7949 commit 78e34c1
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions zds/tutorialv2/tests/tests_views/tests_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 78e34c1

Please sign in to comment.