Skip to content

Commit a349297

Browse files
prepare 0.8.2
1 parent 617cb0a commit a349297

File tree

7 files changed

+29
-19
lines changed

7 files changed

+29
-19
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ are used for versioning (schema follows below):
1515
0.3.4 to 0.4).
1616
- All backwards incompatible changes are mentioned in this document.
1717

18+
0.8.2
19+
-----
20+
2018-06-05
21+
22+
- Minor fixes.
23+
1824
0.8.1
1925
-----
2026
2018-06-05

docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ are used for versioning (schema follows below):
1515
0.3.4 to 0.4).
1616
- All backwards incompatible changes are mentioned in this document.
1717

18+
0.8.2
19+
-----
20+
2018-06-05
21+
22+
- Minor fixes.
23+
1824
0.8.1
1925
-----
2026
2018-06-05

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import find_packages, setup
44

5-
version = '0.8.1'
5+
version = '0.8.2'
66

77
DOCS_TRANSFORMATIONS = (
88
(

src/django_elasticsearch_dsl_drf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
__title__ = 'django-elasticsearch-dsl-drf'
6-
__version__ = '0.8.1'
6+
__version__ = '0.8.2'
77
__author__ = 'Artur Barseghyan <[email protected]>'
88
__copyright__ = '2017-2018 Artur Barseghyan'
99
__license__ = 'GPL 2.0/LGPL 2.1'

src/django_elasticsearch_dsl_drf/filter_backends/suggester/functional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,12 @@ def serialize_queryset(self,
401401
hits.append(hit)
402402

403403
data = {
404-
suggester_name: {
404+
suggester_name: [{
405405
'text': value,
406406
'options': hits,
407407
'length': len(value),
408408
'offset': 0,
409-
},
409+
}],
410410
'_shards': result['_shards'],
411411
}
412412
return data

src/django_elasticsearch_dsl_drf/tests/test_functional_suggesters.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,18 +193,16 @@ def _test_suggesters(self, test_data, url):
193193

194194
for _test_case, _expected_results in _test_cases.items():
195195
# Check if response now is valid
196-
197196
response = self.client.get(
198197
url + '?' + _suggester_field + '=' + _test_case,
199198
data
200199
)
201-
# import pytest; pytest.set_trace()
202200
self.assertEqual(response.status_code, status.HTTP_200_OK)
203201
self.assertIn(_suggester_field, response.data)
204202
_unique_options = list(set([
205203
__o['text']
206204
for __o
207-
in response.data[_suggester_field]['options']
205+
in response.data[_suggester_field][0]['options']
208206
]))
209207
self.assertEqual(
210208
len(_unique_options),

src/django_elasticsearch_dsl_drf/tests/test_suggesters.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -189,30 +189,30 @@ def _test_suggesters(self, test_data, url):
189189

190190
data = {}
191191

192-
for __suggester_field, __test_cases in test_data.items():
192+
for _suggester_field, _test_cases in test_data.items():
193193

194-
for __test_case, __expected_results in __test_cases.items():
194+
for _test_case, _expected_results in _test_cases.items():
195195
# Check if response now is valid
196196
response = self.client.get(
197-
url + '?' + __suggester_field + '=' + __test_case,
197+
url + '?' + _suggester_field + '=' + _test_case,
198198
data
199199
)
200200
self.assertEqual(response.status_code, status.HTTP_200_OK)
201-
self.assertIn(__suggester_field, response.data)
202-
__unique_options = list(set([
201+
self.assertIn(_suggester_field, response.data)
202+
_unique_options = list(set([
203203
__o['text']
204204
for __o
205-
in response.data[__suggester_field][0]['options']
205+
in response.data[_suggester_field][0]['options']
206206
]))
207207
self.assertEqual(
208-
len(__unique_options),
209-
len(__expected_results),
210-
(__test_case, __expected_results)
208+
len(_unique_options),
209+
len(_expected_results),
210+
(_test_case, _expected_results)
211211
)
212212
self.assertEqual(
213-
sorted(__unique_options),
214-
sorted(__expected_results),
215-
(__test_case, __expected_results)
213+
sorted(_unique_options),
214+
sorted(_expected_results),
215+
(_test_case, _expected_results)
216216
)
217217

218218
def test_suggesters_completion(self):

0 commit comments

Comments
 (0)