From 31d89d29b81a49cfe26d888e117415521e0a2fb9 Mon Sep 17 00:00:00 2001 From: DonHaul Date: Mon, 17 Jun 2024 13:48:08 +0200 Subject: [PATCH] tests: fix tests --- backoffice/workflows/api/views.py | 6 +----- backoffice/workflows/documents.py | 1 - backoffice/workflows/tests/test_views.py | 8 ++++---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/backoffice/workflows/api/views.py b/backoffice/workflows/api/views.py index b36f9b9b..6987d2c1 100644 --- a/backoffice/workflows/api/views.py +++ b/backoffice/workflows/api/views.py @@ -79,11 +79,7 @@ def __init__(self, *args, **kwargs): serializer_class = WorkflowSerializer pagination_class = OSStandardResultsSetPagination - search_fields = { - "workflow_type", - "status", - "is_update", - } + search_fields = {"workflow_type", "status"} ordering = ["_updated_at"] def get_serializer_class(self): diff --git a/backoffice/workflows/documents.py b/backoffice/workflows/documents.py index edcad401..5b3a8a67 100644 --- a/backoffice/workflows/documents.py +++ b/backoffice/workflows/documents.py @@ -11,7 +11,6 @@ class WorkflowDocument(Document): workflow_type = fields.KeywordField() data = fields.ObjectField() status = fields.KeywordField() - is_update = fields.BooleanField() class Index: name = settings.OPENSEARCH_INDEX_NAMES[__name__] diff --git a/backoffice/workflows/tests/test_views.py b/backoffice/workflows/tests/test_views.py index 81bbcbf6..ffa36e15 100644 --- a/backoffice/workflows/tests/test_views.py +++ b/backoffice/workflows/tests/test_views.py @@ -37,7 +37,7 @@ class TestWorkflowViewSet(BaseTransactionTestCase): def setUp(self): super().setUp() - self.workflow = Workflow.objects.create(data={}, status="approval", core=True, is_update=False) + self.workflow = Workflow.objects.create(data={}, status="approval", core=True) def test_list_curator(self): self.api_client.force_authenticate(user=self.curator) @@ -70,7 +70,7 @@ def setUp(self): super().setUp() index = Index("backoffice-backend-test-workflows") index.delete(ignore=[400, 404]) - self.workflow = Workflow.objects.create(data={}, status="approval", core=True, is_update=False) + self.workflow = Workflow.objects.create(data={}, status="approval", core=True) def test_list_curator(self): self.api_client.force_authenticate(user=self.curator) @@ -100,7 +100,7 @@ class TestWorkflowPartialUpdateViewSet(BaseTransactionTestCase): def setUp(self): super().setUp() - self.workflow = Workflow.objects.create(data={}, status="approval", core=True, is_update=False) + self.workflow = Workflow.objects.create(data={}, status="approval", core=True) @property def endpoint(self): @@ -139,7 +139,7 @@ class TestWorkflowTicketViewSet(BaseTransactionTestCase): def setUp(self): super().setUp() - self.workflow = Workflow.objects.create(data={}, status="running", core=True, is_update=False) + self.workflow = Workflow.objects.create(data={}, status="running", core=True) self.workflow_ticket = WorkflowTicket.objects.create( workflow_id=self.workflow, ticket_id="123", ticket_type="author_create_user" )