Skip to content

Commit a421aa4

Browse files
clean up
1 parent c2ddeb0 commit a421aa4

File tree

1 file changed

+7
-24
lines changed

1 file changed

+7
-24
lines changed

src/django_elasticsearch_dsl_drf/tests/test_filtering_geo_spatial.py

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def test_field_filter_geo_distance(self):
8888
self.assertEqual(len(response.data['results']), self.geo_in_count + 1)
8989

9090
@pytest.mark.webtest
91-
def _test_field_filter_geo_polygon(self, points, count, fail_test=False):
91+
def _test_field_filter_geo_polygon(self, points, count):
9292
"""Private helper test field filter geo-polygon.
9393
9494
Example:
@@ -98,10 +98,8 @@ def _test_field_filter_geo_polygon(self, points, count, fail_test=False):
9898
9999
:param points:
100100
:param count:
101-
:param fail_test:
102101
:type points:
103102
:type count:
104-
:type fail_test:
105103
:return:
106104
:rtype:
107105
"""
@@ -116,19 +114,6 @@ def _test_field_filter_geo_polygon(self, points, count, fail_test=False):
116114
29.22,
117115
)
118116

119-
# valid_points = [
120-
# (-23.37, 47.51),
121-
# (-2.81, 63.15),
122-
# (15.99, 46.31),
123-
# (26.54, 42.42),
124-
# ]
125-
#
126-
# invalid_points = [
127-
# (-82.79, 72.34),
128-
# (54.31, 72.34),
129-
# (-6.50, 78.42),
130-
# # (-56.42, 82.78),
131-
# ]
132117
publishers = []
133118

134119
url = self.base_publisher_url[:] + '?{}={}'.format(
@@ -147,7 +132,6 @@ def _test_field_filter_geo_polygon(self, points, count, fail_test=False):
147132

148133
response = self.client.get(url, data)
149134
self.assertEqual(response.status_code, status.HTTP_200_OK)
150-
# Should contain only 4 results
151135
self.assertEqual(len(response.data['results']), count)
152136

153137
return publishers
@@ -166,9 +150,8 @@ def test_field_filter_geo_polygon(self):
166150
]
167151
call_command('search_index', '--rebuild', '-f')
168152
return self._test_field_filter_geo_polygon(
169-
valid_points,
170-
4,
171-
fail_test=False
153+
points=valid_points,
154+
count=4
172155
)
173156

174157
@pytest.mark.webtest
@@ -181,14 +164,14 @@ def test_field_filter_geo_polygon_fail_test(self):
181164
(-82.79, 72.34),
182165
(54.31, 72.34),
183166
(-6.50, 78.42),
184-
# (-56.42, 82.78),
167+
(-56.42, 82.78),
185168
]
186169
call_command('search_index', '--rebuild', '-f')
187170
return self._test_field_filter_geo_polygon(
188-
invalid_points,
189-
0,
190-
fail_test=True
171+
points=invalid_points,
172+
count=0
191173
)
192174

175+
193176
if __name__ == '__main__':
194177
unittest.main()

0 commit comments

Comments
 (0)