diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/caf/tests/factories.py | 22 |
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 |