summaryrefslogtreecommitdiff
path: root/tests/gis_tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2025-04-03 11:15:27 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2025-04-04 21:33:55 +0200
commitd9bf0d07cc13c0351b65b025d7e8063864086975 (patch)
treeaf2b800a9f0acad91836d5bc5138ae713cb5f383 /tests/gis_tests
parent8ebdd37a0b1755842baae3bd34d388156ad4bf53 (diff)
[5.2.x] Fixed #36289 -- Fixed bulk_create() crash with nullable geometry fields on PostGIS.
Swapped to an allow list instead of a deny list for field types to determine if the UNNEST optimization can be enabled to avoid further surprises with other types that would require further specialization to adapt. Regression in a16eedcf9c69d8a11d94cac1811018c5b996d491. Thanks Joshua Goodwin for the report and Sarah Boyce for the test. Backport of 764af7a3d6c0b543dcf659a2c327f214da768fe4 from main
Diffstat (limited to 'tests/gis_tests')
-rw-r--r--tests/gis_tests/geo3d/models.py2
-rw-r--r--tests/gis_tests/geo3d/tests.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/gis_tests/geo3d/models.py b/tests/gis_tests/geo3d/models.py
index 456be077f0..a09c599b02 100644
--- a/tests/gis_tests/geo3d/models.py
+++ b/tests/gis_tests/geo3d/models.py
@@ -58,7 +58,7 @@ class SimpleModel(models.Model):
class Point2D(SimpleModel):
- point = models.PointField()
+ point = models.PointField(null=True)
class Point3D(SimpleModel):
diff --git a/tests/gis_tests/geo3d/tests.py b/tests/gis_tests/geo3d/tests.py
index b37deabb46..6a9376f2f8 100644
--- a/tests/gis_tests/geo3d/tests.py
+++ b/tests/gis_tests/geo3d/tests.py
@@ -206,6 +206,10 @@ class Geo3DTest(Geo3DLoadingHelper, TestCase):
lm.save()
self.assertEqual(3, MultiPoint3D.objects.count())
+ def test_bulk_create_point_field(self):
+ objs = Point2D.objects.bulk_create([Point2D(), Point2D()])
+ self.assertEqual(len(objs), 2)
+
@skipUnlessDBFeature("supports_3d_functions")
def test_union(self):
"""