Skip to content

Commit 6c10d5c

Browse files
authored
Merge pull request #475 from ror-community/single-search-marple-implementation
Adding single search
2 parents c62f0be + 88faf1f commit 6c10d5c

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

rorapi/management/commands/indexror.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import pathlib
1010
import shutil
1111
from rorapi.settings import ES7, ES_VARS, DATA
12-
import random
1312

1413
from django.core.management.base import BaseCommand
1514
from elasticsearch import TransportError

rorapi/tests/tests_unit/tests_views_v2.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ def setUp(self):
2222
'data/test_data_search_es7_v2.json'), 'r') as f:
2323
self.test_data = json.load(f)
2424

25+
@mock.patch('elasticsearch_dsl.Search.execute')
26+
def test_search_organizations_with_affiliations_match(self, search_mock):
27+
view = views.OrganizationViewSet.as_view({'get': 'list'})
28+
request = factory.get('/v2/organizations?affiliation=Sorbonne University, France&single_search= ')
29+
30+
response = view(request, version=self.V2_VERSION)
31+
response.render()
32+
organizations = json.loads(response.content.decode('utf-8'))
33+
34+
print("testing affiliations match: ", organizations)
35+
self.assertNotEqual(organizations['number_of_results'], 0)
36+
37+
2538
@mock.patch('elasticsearch_dsl.Search.execute')
2639
def test_search_organizations(self, search_mock):
2740
search_mock.return_value = \

0 commit comments

Comments
 (0)