aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf/tests
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-02-25 08:19:35 +0000
committerMatthew Lemon <matt@matthewlemon.com>2020-02-25 08:19:35 +0000
commit9269f3c3798b677b4e46abcc5df5f869c9cb9164 (patch)
treeb35b4b6b0e7407e6056084b8e4ad19614e612478 /ctrack/caf/tests
parentfdf52fb15cb594f8717b852c33a292149a21b8b8 (diff)
populate now does gradings
Diffstat (limited to '')
-rw-r--r--ctrack/caf/tests/factories.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/ctrack/caf/tests/factories.py b/ctrack/caf/tests/factories.py
index ec02bce..bae0d9c 100644
--- a/ctrack/caf/tests/factories.py
+++ b/ctrack/caf/tests/factories.py
@@ -1,17 +1,31 @@
import factory
-from ctrack.caf.models import CAF, EssentialService
+from factory import Faker
+
+from ctrack.caf.models import CAF, EssentialService, Grading
from ctrack.organisations.tests.factories import PersonFactory
class EssentialServiceFactory(factory.DjangoModelFactory):
"""Factory for Essential Services."""
- model = EssentialService
+
+ class Meta:
+ model = EssentialService
+
+
+class GradingFactory(factory.DjangoModelFactory):
+ descriptor = factory.Iterator(["Q1", "Q2", "Q3", "Q4", "Q5", "C1", "C2", "C3", "C4", "C5"])
+ description = Faker("text", max_nb_chars=100, ext_word_list=None)
+ type = factory.Iterator(Grading.GRADING_TYPE, getter=lambda g: g[0])
+
+ class Meta:
+ model = Grading
class CAFFactory(factory.DjangoModelFactory):
"""Factory for CAFs."""
- model = CAF
owner = factory.SubFactory(PersonFactory)
# triage_ranking = factory.SubFactory(TriageRankingFactory)
-# TODO - we want an abstract Ranking
+
+ class Meta:
+ model = CAF