aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/tests/factories.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/users/tests/factories.py15
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")