aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations/tests/factories.py
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-02-20 13:33:48 +0000
committerMatthew Lemon <matt@matthewlemon.com>2020-02-20 13:33:48 +0000
commit9c1e4edd81d676c92503061c24f7e8660cc94482 (patch)
tree485e3af65a192196ac73402e6b6b5279e758f8a0 /ctrack/organisations/tests/factories.py
parent7523b27d1e67fa32584f1d34777faf2e53ce6edf (diff)
failing test - need to tweak db
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/tests/factories.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py
index aaca669..99a4bb3 100644
--- a/ctrack/organisations/tests/factories.py
+++ b/ctrack/organisations/tests/factories.py
@@ -5,7 +5,7 @@ import factory
from django.contrib.auth import get_user_model
from factory import DjangoModelFactory, Faker, SubFactory, post_generation
-from ctrack.organisations.models import Mode, Organisation, Person, Role, Submode
+from ctrack.organisations.models import Mode, Organisation, Person, Role, Submode, Address, AddressType
User = get_user_model()
@@ -112,3 +112,26 @@ class PersonFactory(DjangoModelFactory):
date_ended = Faker("date_this_year")
predecessor = SubFactory("ctrack.organisations.tests.factories.PersonFactory")
comments = "Yaa!"
+
+
+class AddressFactory(DjangoModelFactory):
+ type = SubFactory("ctrack.organisations.tests.factories.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")
+ city = Faker("city", locale="en_GB")
+ county = Faker("lexify", locale="en_GB", text="??????", letters="aeioutzyj")
+ postcode = Faker("postcode", locale="en_GB")
+ country = Faker("country")
+ other_details = Faker("lexify", locale="en_GB", text="??????", letters="aeioutzyj")
+
+ class Meta:
+ model = Address
+
+
+class AddressTypeFactory(DjangoModelFactory):
+ descriptor = "Primary Address"
+
+ class Meta:
+ model = AddressType