Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
tests: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Jun 17, 2024
1 parent 1e00cf3 commit 31d89d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
6 changes: 1 addition & 5 deletions backoffice/workflows/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion backoffice/workflows/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__]
Expand Down
8 changes: 4 additions & 4 deletions backoffice/workflows/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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"
)
Expand Down

0 comments on commit 31d89d2

Please sign in to comment.