Skip to content

Commit

Permalink
Merge branch 'dev' into zmd
Browse files Browse the repository at this point in the history
  • Loading branch information
philippemilink authored Oct 13, 2023
2 parents e0fd138 + 8e13b69 commit aa8fa06
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions zds/member/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ class Meta:

is_active = True

@classmethod
def _after_postgeneration(cls, instance, create, results=None):
"""
Save the instance again after the post generation operations. Needed to save
the password which is set in a post generation method call.
Skip the save when the object was ‘built’ and not ‘created’. See the Factory Boy
documentation for details on those build strategies.
This method replaces the deprecated method from DjangoModelFactory which is
scheduled to be removed in the next major release (see factory_boy's changelog
entry for version 3.3.0).
"""
if create:
instance.save()


class StaffFactory(UserFactory):
"""
Expand Down

0 comments on commit aa8fa06

Please sign in to comment.