From b63831acf097b82410546548306cefb03e6474c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Mon, 16 Dec 2024 11:11:27 +0100 Subject: [PATCH] fix(EmailGroupFactory): skip post-generation save to prevent duplicate key errors --- lemarche/conversations/factories.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lemarche/conversations/factories.py b/lemarche/conversations/factories.py index 24014abb4..1b8c073fe 100644 --- a/lemarche/conversations/factories.py +++ b/lemarche/conversations/factories.py @@ -20,6 +20,7 @@ class Meta: class EmailGroupFactory(DjangoModelFactory): class Meta: model = EmailGroup + skip_postgeneration_save = True # To avoid error "duplicate key" when saving TemplateTransactional factory display_name = factory.Faker("name", locale="fr_FR") description = factory.Faker("name", locale="fr_FR")