Skip to content

Commit

Permalink
chore: suppression des deprecation warning sur factory_boy (#710)
Browse files Browse the repository at this point in the history
## Description

🎸 Mise à jour du paramètre `._after_postgeneration` des factories du
projet
 
## Type de changement

🚧 technique
  • Loading branch information
vincentporte authored Jul 4, 2024
1 parent 6705ead commit 0957c84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lacommunaute/forum/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class ForumRatingFactory(factory.django.DjangoModelFactory):

class Meta:
model = ForumRating
skip_postgeneration_save = True

@factory.post_generation
def set_created(self, create, extracted, **kwargs):
Expand Down
1 change: 1 addition & 0 deletions lacommunaute/surveys/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
class DSPFactory(factory.django.DjangoModelFactory):
class Meta:
model = DSP
skip_postgeneration_save = True

user = factory.SubFactory(UserFactory)
work_capacity = factory.Faker("pyint", min_value=0, max_value=3)
Expand Down
1 change: 1 addition & 0 deletions lacommunaute/users/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Meta:
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = User
skip_postgeneration_save = True

username = factory.LazyAttribute(
lambda a: "{}_{}_{}".format(a.first_name, a.last_name, random.randrange(111, 999))
Expand Down

0 comments on commit 0957c84

Please sign in to comment.