diff --git a/scipost/factories.py b/scipost/factories.py index c69b975f60db3f7f1b5952012384a719ecc7c9bb..43ada4094270c7b4387a365be7a4907404d336cc 100644 --- a/scipost/factories.py +++ b/scipost/factories.py @@ -16,6 +16,14 @@ class ContributorFactory(factory.django.DjangoModelFactory): vetted_by = factory.SubFactory('scipost.factories.ContributorFactory', vetted_by=None) +class VettingEditorFactory(ContributorFactory): + @factory.post_generation + def add_to_vetting_editors(self, create, extracted, **kwargs): + if not create: + return + self.user.groups.add(Group.objects.get(name="Vetting Editors")) + + class UserFactory(factory.django.DjangoModelFactory): class Meta: model = get_user_model()