🗃️(database) create invitation model
Create invitation model, factory and related tests to prepare back-end for invitation endpoints. We chose to use a separate dedicated model for separation of concerns, see https://github.com/numerique-gouv/people/issues/25
This commit is contained in:
committed by
Marie
parent
6080af961a
commit
8e537d962c
@@ -170,3 +170,15 @@ class TeamAccessFactory(factory.django.DjangoModelFactory):
|
||||
team = factory.SubFactory(TeamFactory)
|
||||
user = factory.SubFactory(UserFactory)
|
||||
role = factory.fuzzy.FuzzyChoice([r[0] for r in models.RoleChoices.choices])
|
||||
|
||||
|
||||
class InvitationFactory(factory.django.DjangoModelFactory):
|
||||
"""A factory to create invitations for a user"""
|
||||
|
||||
class Meta:
|
||||
model = models.Invitation
|
||||
|
||||
email = factory.Faker("email")
|
||||
team = factory.SubFactory(TeamFactory)
|
||||
role = factory.fuzzy.FuzzyChoice([role[0] for role in models.RoleChoices.choices])
|
||||
issuer = factory.SubFactory(UserFactory)
|
||||
|
||||
Reference in New Issue
Block a user