Skip to content

Commit

Permalink
Merge pull request #98 from DonHaul/decisions-on-search
Browse files Browse the repository at this point in the history
backoffice: decision added to search
  • Loading branch information
karolina-siemieniuk-morawska authored Aug 28, 2024
2 parents d52647a + beb6a69 commit 77ece53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions backoffice/backoffice/workflows/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ class WorkflowDocument(Document):
),
}
)

decisions = fields.NestedField(
properties={
"action": fields.TextField(),
"user": fields.ObjectField(properties={"email": fields.TextField()}),
}
)

status = fields.KeywordField()
is_update = fields.BooleanField()

Expand Down
8 changes: 7 additions & 1 deletion backoffice/backoffice/workflows/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_delete(self):


class TestWorkflowSearchViewSet(BaseTransactionTestCase):
endpoint = "/api/workflows/search/"
endpoint = reverse("search:workflow-list")
reset_sequences = True
fixtures = ["backoffice/fixtures/groups.json"]

Expand Down Expand Up @@ -169,6 +169,12 @@ def test_list_anonymous(self):

self.assertEqual(response.status_code, 403)

def test_contains_decisions(self):
self.api_client.force_authenticate(user=self.admin)

response = self.api_client.get(self.endpoint)
self.assertIn("decisions", response.json()["results"][0])


class TestAuthorWorkflowPartialUpdateViewSet(BaseTransactionTestCase):
endpoint_base_url = "/api/workflow-update"
Expand Down

0 comments on commit 77ece53

Please sign in to comment.