diff options
Diffstat (limited to 'ctrack/organisations/tests/factories.py')
-rw-r--r-- | ctrack/organisations/tests/factories.py | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py index 3bad765..61f2ae3 100644 --- a/ctrack/organisations/tests/factories.py +++ b/ctrack/organisations/tests/factories.py @@ -40,28 +40,13 @@ class UserFactory(DjangoModelFactory): password = Faker("lexify", text="????????", letters="AdOIqkcvBnMP") -class ModeFactory(DjangoModelFactory): - class Meta: - model = Mode - - descriptor = factory.LazyFunction(_random_mode) - - -class SubModeFactory(DjangoModelFactory): - class Meta: - model = Submode - - descriptor = factory.LazyFunction(_random_submode) - mode = SubFactory(ModeFactory) - - class OrganisationFactory(DjangoModelFactory): class Meta: model = Organisation name = Faker("company") slug = Faker("lexify", text="????", letters="abcdsg") - submode = SubFactory(SubModeFactory) +# submode = SubFactory(SubModeFactory) designation_type = 1 registered_company_name = Faker("company") registered_company_number = Faker("numerify", text="######") @@ -82,6 +67,14 @@ class PersonFactory(DjangoModelFactory): class Meta: model = Person + # @post_generation + # def organisation(self, create, extracted, **kwargs): + # if not create: + # return + # if extracted: + # for org in extracted: + # self.organisation.add(org) + @post_generation def role(self, create, extracted, **kwargs): if not create: |