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

Commit

Permalink
backoffice: fix restart with params
Browse files Browse the repository at this point in the history
  • Loading branch information
DonHaul committed Aug 30, 2024
1 parent 9efc7fe commit 0f587d0
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
17 changes: 15 additions & 2 deletions backoffice/backoffice/workflows/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from django.test import TransactionTestCase
from django.urls import reverse
from django_opensearch_dsl.registries import registry
from parameterized import parameterized
from rest_framework import status
from rest_framework.test import APIClient

Expand Down Expand Up @@ -492,7 +493,7 @@ def setUpClass(cls):
],
"name": {"value": "Smith, John", "preferred_name": "John Smith"},
"email_addresses": [
{"value": "john.smith@someting.ch", "current": True}
{"value": "john.smith@something.ch", "current": True}
],
},
status=StatusChoices.RUNNING,
Expand All @@ -516,10 +517,22 @@ def test_search_data_name(self):

response = self.api_client.get(url)
results = response.json()["results"]

assert len(results) == 1
assert results[0]["data"]["name"]["value"] == "Smith, John"

@parameterized.expand(["?search=", "?search=data.email_addresses.value:"])
def test_search_data_email(self, query_params):
self.api_client.force_authenticate(user=self.admin)

email = "[email protected]"

url = reverse("search:workflow-list") + f"{query_params}{email}"

response = self.api_client.get(url)
results = response.json()["results"]
assert len(results) == 1
assert results[0]["data"]["email_addresses"][0]["value"] == email

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

Expand Down
16 changes: 15 additions & 1 deletion backoffice/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backoffice/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ opensearch-py = "2.6.0"
djangorestframework-simplejwt = "^5.3.1"
django-json-widget = "^2.0.1"
sentry-sdk = "1.19.1"
parameterized = "^0.9.0"

[tool.poetry.dev-dependencies]
factory-boy = "3.3.0"
Expand Down

0 comments on commit 0f587d0

Please sign in to comment.