1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Made OracleSpatialAdapter clone geometries rather than mutate them.

This commit is contained in:
Tim Graham
2020-10-21 20:20:26 -04:00
committed by Mariusz Felisiak
parent 49ece89702
commit 7734337bcb
6 changed files with 44 additions and 13 deletions

View File

@@ -79,7 +79,7 @@ class GeoModelTest(TestCase):
nullstate.save()
ns = State.objects.get(name='NullState')
self.assertEqual(ply, ns.poly)
self.assertEqual(connection.ops.Adapter._fix_polygon(ply), ns.poly)
# Testing the `ogr` and `srs` lazy-geometry properties.
self.assertIsInstance(ns.poly.ogr, gdal.OGRGeometry)
@@ -93,7 +93,10 @@ class GeoModelTest(TestCase):
ply[1] = new_inner
self.assertEqual(4326, ns.poly.srid)
ns.save()
self.assertEqual(ply, State.objects.get(name='NullState').poly)
self.assertEqual(
connection.ops.Adapter._fix_polygon(ply),
State.objects.get(name='NullState').poly
)
ns.delete()
@skipUnlessDBFeature("supports_transform")