diff options
Diffstat (limited to 'ctrack/users/tests/factories.py')
-rw-r--r-- | ctrack/users/tests/factories.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ctrack/users/tests/factories.py b/ctrack/users/tests/factories.py index 9907945..53584b7 100644 --- a/ctrack/users/tests/factories.py +++ b/ctrack/users/tests/factories.py @@ -6,15 +6,22 @@ from factory import DjangoModelFactory, Faker, post_generation, SubFactory class AddressTypeFactory(DjangoModelFactory): - descriptor = "Primary Address" class Meta: model = AddressType +class OrganisationFactory(DjangoModelFactory): + name = Faker("company", locale="en_GB") + + class Meta: + model = Organisation + + class AddressFactory(DjangoModelFactory): type = SubFactory(AddressTypeFactory) + organisation = SubFactory(OrganisationFactory) line1 = Faker("secondary_address", locale="en_GB") line2 = Faker("street_name", locale="en_GB") line3 = Faker("secondary_address", locale="en_GB") @@ -28,14 +35,6 @@ class AddressFactory(DjangoModelFactory): model = Address -class OrganisationFactory(DjangoModelFactory): - name = Faker("company", locale="en_GB") - address = SubFactory(AddressFactory) - - class Meta: - model = Organisation - - class UserFactory(DjangoModelFactory): username = Faker("user_name") email = Faker("email") |