Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud-D committed Mar 6, 2024
1 parent 7b054b1 commit dd20c86
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions zds/tutorialv2/tests/tests_views/tests_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 !!

Expand Down
2 changes: 1 addition & 1 deletion zds/tutorialv2/views/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dd20c86

Please sign in to comment.