Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
add factory for ContactType
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreJunod committed Aug 15, 2023
1 parent ed43ec4 commit 8026e20
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions geocity/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,19 @@ def administrative_entities(self, create, extracted, **kwargs):
self.administrative_entities.add(*extracted)


class ContactTypeFactory(factory.django.DjangoModelFactory):
class Meta:
model = submissions_models.ContactForm

name = factory.Faker("word")


class ContactFormFactory(factory.django.DjangoModelFactory):
class Meta:
model = submissions_models.ContactForm

form_category = factory.SubFactory(FormCategoryFactory)
type = factory.SubFactory(ContactTypeFactory)

@factory.post_generation
def integrator(self, create, extracted, **kwargs):
Expand Down

0 comments on commit 8026e20

Please sign in to comment.