Skip to content

Commit

Permalink
Corrige 'test_export_content'
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud-D committed Sep 16, 2024
1 parent cd210e4 commit 2f7bb31
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions zds/tutorialv2/tests/tests_views/tests_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,18 +930,10 @@ def test_export_content(self):
given_title = "Oh, le beau titre à lire !"
some_text = "À lire à un moment ou un autre, Über utile" # accentuated characters are important for the test

# create a tutorial
# Create a tutorial and modify its introduction and conclusion
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)
Expand All @@ -951,6 +943,20 @@ def test_export_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]),
Expand Down

0 comments on commit 2f7bb31

Please sign in to comment.