diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-01-21 16:37:09 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-01-21 16:37:09 +0000 |
commit | 1aade17fe69e52973fd43c4090dbdfaf50009c89 (patch) | |
tree | 3efa176ff0ebd7d94b203a29b9a4e1bc401665ac /ctrack/users/tests/factories.py | |
parent | 0bfe3454fde753425d37246b73b3eda1b9a756b9 (diff) |
passing test - added address type model
Diffstat (limited to '')
-rw-r--r-- | ctrack/users/tests/factories.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/ctrack/users/tests/factories.py b/ctrack/users/tests/factories.py index 6c5c7cd..0a4acd6 100644 --- a/ctrack/users/tests/factories.py +++ b/ctrack/users/tests/factories.py @@ -1,19 +1,27 @@ from typing import Any, Sequence from django.contrib.auth import get_user_model -from ctrack.organisations.models import Organisation, Address -from factory import DjangoModelFactory, Faker, post_generation +from ctrack.organisations.models import Organisation, Address, AddressType +from factory import DjangoModelFactory, Faker, post_generation, SubFactory class OrganisationFactory(DjangoModelFactory): - name = Faker("company", locale="en_GB") class Meta: model = Organisation +class AddressTypeFactory(DjangoModelFactory): + + descriptor = "Primary Address" + + class Meta: + model = AddressType + + class AddressFactory(DjangoModelFactory): + type = SubFactory(AddressTypeFactory) line1 = Faker("secondary_address", locale="en_GB") line2 = Faker("street_name", locale="en_GB") line3 = Faker("secondary_address", locale="en_GB") @@ -28,7 +36,6 @@ class AddressFactory(DjangoModelFactory): class UserFactory(DjangoModelFactory): - username = Faker("user_name") email = Faker("email") name = Faker("name") |