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:04 +0200
commit764af7a3d6c0b543dcf659a2c327f214da768fe4 (patch)
tree2ef6d8c15ef6c2df0b8c481c0f0bde3f09b6a4fb /tests/gis_tests
parent4a824b13134a63d189a58e68f925e7201fa3befe (diff)
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.
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):
"""