Skip to content

Commit e71495e

Browse files
committed
Update osmcha and DRF-gis libraries
1 parent 7eff21e commit e71495e

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

osmchadjango/supervise/tests/test_views.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import xml.etree.ElementTree as ET
44

55
from django.urls import reverse
6-
from django.contrib.gis.geos import MultiPolygon, Polygon, Point, LineString
6+
from django.contrib.gis.geos import MultiPolygon, Polygon, Point, LineString, GEOSGeometry
77

88
from rest_framework.test import APITestCase
99
from social_django.models import UserSocialAuth
@@ -228,10 +228,13 @@ def test_auto_user_field(self):
228228

229229
class TestAoIDetailAPIViews(APITestCase):
230230
def setUp(self):
231-
self.m_polygon = MultiPolygon(
232-
Polygon(((0, 0), (0, 1), (1, 1), (0, 0))),
233-
Polygon(((1, 1), (1, 2), (2, 2), (1, 1)))
234-
)
231+
self.m_polygon = {
232+
"type": "MultiPolygon",
233+
"coordinates": [
234+
[ [ [ 0.0, 0.0 ], [ 0.0, 1.0 ], [ 1.0, 1.0 ], [ 0.0, 0.0 ] ] ],
235+
[ [ [ 1.0, 1.0 ], [ 1.0, 2.0 ], [ 2.0, 2.0 ], [ 1.0, 1.0 ] ] ]
236+
]
237+
}
235238
self.user = User.objects.create_user(
236239
username='test_user',
237240
@@ -245,14 +248,14 @@ def setUp(self):
245248
self.aoi = AreaOfInterest.objects.create(
246249
name='Best place in the world',
247250
user=self.user,
248-
geometry=self.m_polygon,
251+
geometry=GEOSGeometry(f'{self.m_polygon}'),
249252
filters={
250253
'editor': 'Potlatch 2',
251254
'harmful': 'False',
252255
'users': 'test',
253256
'uids': '234,43',
254257
'checked_by': 'qa_user',
255-
'geometry': self.m_polygon.geojson
258+
'geometry': self.m_polygon
256259
},
257260
)
258261
self.m_polygon_2 = MultiPolygon(
@@ -290,7 +293,7 @@ def test_retrieve_detail_authenticated(self):
290293
'users': 'test',
291294
'uids': '234,43',
292295
'checked_by': 'qa_user',
293-
'geometry': self.m_polygon.geojson
296+
'geometry': self.m_polygon
294297
}
295298
)
296299
self.assertEqual(

requirements/base.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ social-auth-core==3.3.3
1717

1818
# DRF and DRF-gis
1919
djangorestframework==3.11.2
20-
djangorestframework-gis==0.16
20+
djangorestframework-gis==0.17
2121
djangorestframework-csv==2.1.1
2222
django-filter==2.4.0
2323
django-cors-headers==3.7.0
@@ -42,7 +42,7 @@ redis>=2.10.5
4242

4343
# Your custom requirements go here
4444
PyYAML==5.4.1
45-
osmcha==0.8.4
45+
osmcha==0.8.5
4646

4747
# git python is required by the frontend management command
4848
GitPython==3.1.17

0 commit comments

Comments
 (0)