aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-09-03 17:25:30 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-09-03 17:25:30 +0100
commit959c001905fffc4840e8f795170d724474bc1997 (patch)
treeb9fec38599e7afbe0dfd832d397b68cf4082c1be /ctrack
parent0d0066bdc03fcafa660db7b002ec2bb5846dc4fd (diff)
factory boy to 3.0.1
Diffstat (limited to 'ctrack')
-rw-r--r--ctrack/caf/tests/factories.py10
-rw-r--r--ctrack/organisations/tests/factories.py3
-rw-r--r--ctrack/register/tests/factories.py4
-rw-r--r--ctrack/users/tests/factories.py3
4 files changed, 11 insertions, 9 deletions
diff --git a/ctrack/caf/tests/factories.py b/ctrack/caf/tests/factories.py
index 7aaf716..f186290 100644
--- a/ctrack/caf/tests/factories.py
+++ b/ctrack/caf/tests/factories.py
@@ -7,7 +7,7 @@ from ctrack.caf.models import ApplicableSystem, Grading, DocumentFile, FileStore
from ctrack.organisations.tests.factories import OrganisationFactory, PersonFactory
-class CAFFactory(factory.DjangoModelFactory):
+class CAFFactory(factory.django.DjangoModelFactory):
quality_grading = factory.SubFactory("ctrack.caf.tests.factories.GradingFactory")
confidence_grading = factory.SubFactory("ctrack.caf.tests.factories.GradingFactory")
organisation = factory.SubFactory("ctrack.organisations.tests.OrganisationFactory")
@@ -23,7 +23,7 @@ class CAFFactory(factory.DjangoModelFactory):
model = CAF
-class ApplicableSystemFactory(factory.DjangoModelFactory):
+class ApplicableSystemFactory(factory.django.DjangoModelFactory):
"""Factory for Essential Services."""
name = Faker("text", max_nb_chars=100, ext_word_list=None)
@@ -36,7 +36,7 @@ class ApplicableSystemFactory(factory.DjangoModelFactory):
model = ApplicableSystem
-class GradingFactory(factory.DjangoModelFactory):
+class GradingFactory(factory.django.DjangoModelFactory):
descriptor = factory.Iterator(
["Q1", "Q2", "Q3", "Q4", "Q5", "C1", "C2", "C3", "C4", "C5"]
)
@@ -47,7 +47,7 @@ class GradingFactory(factory.DjangoModelFactory):
model = Grading
-class FileStoreFactory(factory.DjangoModelFactory):
+class FileStoreFactory(factory.django.DjangoModelFactory):
descriptor = "File Store X"
virtual_location = Faker("street_name")
physical_location = random.choice(["Cupboard A", "Tin Box", "The Vault"])
@@ -57,7 +57,7 @@ class FileStoreFactory(factory.DjangoModelFactory):
model = FileStore
-class DocumentFileFactory(factory.DjangoModelFactory):
+class DocumentFileFactory(factory.django.DjangoModelFactory):
name = Faker("file_name", extension="xlsx")
type = random.choice([1, 2, 3, 4])
file_store_location = factory.SubFactory(FileStoreFactory)
diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py
index a0b700d..17539f2 100644
--- a/ctrack/organisations/tests/factories.py
+++ b/ctrack/organisations/tests/factories.py
@@ -3,7 +3,8 @@ from datetime import datetime
import factory
from django.contrib.auth import get_user_model
-from factory import DjangoModelFactory, Faker, SubFactory, post_generation
+from factory.django import DjangoModelFactory
+from factory import Faker, SubFactory, post_generation
from ctrack.organisations.models import Address, Organisation, Person, Role
diff --git a/ctrack/register/tests/factories.py b/ctrack/register/tests/factories.py
index c93bdda..4334f3d 100644
--- a/ctrack/register/tests/factories.py
+++ b/ctrack/register/tests/factories.py
@@ -36,7 +36,7 @@ def _regulation_scrambler():
)
-class EngagementTypeFactory(factory.DjangoModelFactory):
+class EngagementTypeFactory(factory.django.DjangoModelFactory):
class Meta:
model = EngagementType
@@ -45,7 +45,7 @@ class EngagementTypeFactory(factory.DjangoModelFactory):
regulation_reference = factory.LazyFunction(_regulation_scrambler)
-class EngagementEventFactory(factory.DjangoModelFactory):
+class EngagementEventFactory(factory.django.DjangoModelFactory):
class Meta:
model = EngagementEvent
diff --git a/ctrack/users/tests/factories.py b/ctrack/users/tests/factories.py
index b4ddad0..595c6a6 100644
--- a/ctrack/users/tests/factories.py
+++ b/ctrack/users/tests/factories.py
@@ -1,7 +1,8 @@
from typing import Any, Sequence
from django.contrib.auth import get_user_model
-from factory import DjangoModelFactory, Faker, post_generation
+from factory import Faker, post_generation
+from factory.django import DjangoModelFactory
class UserFactory(DjangoModelFactory):