Commit 57578ceb authored by Joern jkuensem's avatar Joern jkuensem Committed by Jorrit Schaap

TMSS-145: Fix tests that broke due to default titles based on class names by...

TMSS-145: Fix tests that broke due to default titles based on class names by overriding with proper names
parent e147c5cf
......@@ -140,6 +140,12 @@ class SubtaskViewSetJSONeditorOnline(LOFARViewSet):
queryset = models.Subtask.objects.all()
serializer_class = serializers.SubtaskSerializerJSONeditorOnline
def get_view_name(self): # override name because DRF auto-naming does not produce something usable here
name = "Subtask"
if self.suffix:
name += ' ' + self.suffix
return name
def get_queryset(self):
if 'task_blueprint_pk' in self.kwargs:
task_blueprint = get_object_or_404(models.TaskBlueprint, pk=self.kwargs['task_blueprint_pk'])
......
......@@ -182,14 +182,25 @@ class TaskRelationBlueprintViewSet(LOFARViewSet):
# --- JSON
class TaskBlueprintViewSetJSONeditorOnline(LOFARViewSet):
queryset = models.TaskBlueprint.objects.all()
serializer_class = serializers.TaskBlueprintSerializerJSONeditorOnline
queryset = models.TaskBlueprint.objects.all()
serializer_class = serializers.TaskBlueprintSerializerJSONeditorOnline
def get_view_name(self): # override name because DRF auto-naming does not produce something usable here
name = "Task Blueprint"
if self.suffix:
name += ' ' + self.suffix
return name
class TaskDraftViewSetJSONeditorOnline(LOFARViewSet):
queryset = models.TaskDraft.objects.all()
serializer_class = serializers.TaskDraftSerializerJSONeditorOnline
def get_view_name(self): # override name because DRF auto-naming does not produce something usable here
name = "Task Draft"
if self.suffix:
name += ' ' + self.suffix
return name
def get_queryset(self):
if 'scheduling_unit_draft_pk' in self.kwargs:
scheduling_unit_draft = get_object_or_404(models.SchedulingUnitDraft, pk=self.kwargs['scheduling_unit_draft_pk'])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment