From dd20c8642cbed09b46564c08fb692dbe977b97dd Mon Sep 17 00:00:00 2001 From: Arnaud-D <35631001+Arnaud-D@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:12:40 +0100 Subject: [PATCH] wip --- zds/tutorialv2/tests/tests_views/tests_content.py | 6 ------ zds/tutorialv2/views/contents.py | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/zds/tutorialv2/tests/tests_views/tests_content.py b/zds/tutorialv2/tests/tests_views/tests_content.py index 565727fc62..ccc666e030 100644 --- a/zds/tutorialv2/tests/tests_views/tests_content.py +++ b/zds/tutorialv2/tests/tests_views/tests_content.py @@ -303,8 +303,6 @@ def test_basic_tutorial_workflow(self): result = self.client.post( reverse("content:edit", args=[pk, slug]), { - "title": random, - "description": random, "introduction": random, "conclusion": random, "type": "TUTORIAL", @@ -319,15 +317,11 @@ def test_basic_tutorial_workflow(self): self.assertEqual(Image.objects.filter(gallery__pk=tuto.gallery.pk).count(), 2) # new icon is uploaded tuto = PublishableContent.objects.get(pk=pk) - self.assertEqual(tuto.title, random) - self.assertEqual(tuto.description, random) self.assertEqual(tuto.licence, None) versioned = tuto.load_version() self.assertEqual(versioned.get_introduction(), random) self.assertEqual(versioned.get_conclusion(), random) - self.assertEqual(versioned.description, random) self.assertEqual(versioned.licence, None) - self.assertNotEqual(versioned.slug, slug) slug = tuto.slug # make the title change also change the slug !! diff --git a/zds/tutorialv2/views/contents.py b/zds/tutorialv2/views/contents.py index 295d78f3e9..28ff7111bb 100644 --- a/zds/tutorialv2/views/contents.py +++ b/zds/tutorialv2/views/contents.py @@ -186,7 +186,7 @@ def form_valid(self, form): "slug": slugify(publishable.title), "pubdate": datetime.now(), } - gallery, _ = Gallery.objects.get_or_create(pk=publishable.gallery.pk, defaults=gallery_defaults) + gallery, _created = Gallery.objects.get_or_create(pk=publishable.gallery.pk, defaults=gallery_defaults) mixin = ImageCreateMixin() mixin.gallery = gallery try: