From 1219cf1eafedd23db6bdc1f7282cc97abaa0cf10 Mon Sep 17 00:00:00 2001 From: David Vogt Date: Wed, 22 Dec 2021 16:38:25 +0100 Subject: [PATCH] fix: coverage in new status fields Those status fields are only used for the type system, but not as actual input types. Thus, they're never actually instantiated --- caluma/caluma_workflow/serializers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/caluma/caluma_workflow/serializers.py b/caluma/caluma_workflow/serializers.py index 0fea8f712..e73008f75 100644 --- a/caluma/caluma_workflow/serializers.py +++ b/caluma/caluma_workflow/serializers.py @@ -37,12 +37,16 @@ def __init__(self, **kwargs): class CaseStatusField(serializers.CalumaChoiceField): - def __init__(self, **kwargs): + # Required for the type system, case status is + # never part of an input + def __init__(self, **kwargs): # pragma: no cover super().__init__([s for s, _ in models.Case.STATUS_CHOICE_TUPLE], **kwargs) class WorkItemStatusField(serializers.CalumaChoiceField): - def __init__(self, **kwargs): + # Required for the type system, workitem status is + # never part of an input + def __init__(self, **kwargs): # pragma: no cover super().__init__([s for s, _ in models.WorkItem.STATUS_CHOICE_TUPLE], **kwargs)