From 074b559f530c411de5ae4e758236152e84d37ed3 Mon Sep 17 00:00:00 2001
From: George Katsikas <giorgakis.katsikas@gmail.com>
Date: Wed, 17 Apr 2024 12:22:47 +0200
Subject: [PATCH] fix flaky test by shortening slug

---
 scipost_django/blog/factories.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scipost_django/blog/factories.py b/scipost_django/blog/factories.py
index a5138dfaf..b60a1a598 100644
--- a/scipost_django/blog/factories.py
+++ b/scipost_django/blog/factories.py
@@ -25,7 +25,7 @@ class BlogPostFactory(factory.django.DjangoModelFactory):
 
     status = LazyRandEnum(BlogPost.STATUS_CHOICES)
     title = factory.Faker("sentence")
-    slug = factory.LazyAttribute(lambda self: slugify(self.title))
+    slug = factory.LazyAttribute(lambda self: slugify(self.title.split(" ")[:3]))
     blurb = factory.Faker("paragraph")
     blurb_image = factory.django.ImageField()
     blurb_image_caption = factory.Faker("paragraph")
-- 
GitLab