This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from DonHaul/search-improvement-simple
fixed email string
- Loading branch information
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -490,7 +491,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, | ||
|
@@ -514,10 +515,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) | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters