From 118df57d8d983d56288255acb7268a2131d97db2 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 14 Oct 2025 10:37:25 +0200 Subject: [PATCH 1/3] Moved object creation to subTest() in GISFunctionsTests.test_geometry_type() test. --- tests/gis_tests/geoapp/test_functions.py | 49 ++++++++++++------------ 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index b1ab4340aa60..6a0f3e1f343a 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -916,39 +916,38 @@ def test_argument_validation(self): @skipUnlessDBFeature("has_GeometryType_function") def test_geometry_type(self): - Feature.objects.bulk_create( - [ - Feature(name="Point", geom=Point(0, 0)), - Feature(name="LineString", geom=LineString((0, 0), (1, 1))), - Feature(name="Polygon", geom=Polygon(((0, 0), (1, 0), (1, 1), (0, 0)))), - Feature(name="MultiPoint", geom=MultiPoint(Point(0, 0), Point(1, 1))), - Feature( - name="MultiLineString", - geom=MultiLineString( - LineString((0, 0), (1, 1)), LineString((1, 1), (2, 2)) - ), + test_features = [ + Feature(name="Point", geom=Point(0, 0)), + Feature(name="LineString", geom=LineString((0, 0), (1, 1))), + Feature(name="Polygon", geom=Polygon(((0, 0), (1, 0), (1, 1), (0, 0)))), + Feature(name="MultiPoint", geom=MultiPoint(Point(0, 0), Point(1, 1))), + Feature( + name="MultiLineString", + geom=MultiLineString( + LineString((0, 0), (1, 1)), LineString((1, 1), (2, 2)) ), - Feature( - name="MultiPolygon", - geom=MultiPolygon( - Polygon(((0, 0), (1, 0), (1, 1), (0, 0))), - Polygon(((1, 1), (2, 1), (2, 2), (1, 1))), - ), + ), + Feature( + name="MultiPolygon", + geom=MultiPolygon( + Polygon(((0, 0), (1, 0), (1, 1), (0, 0))), + Polygon(((1, 1), (2, 1), (2, 2), (1, 1))), ), - ] - ) - - expected_results = { + ), + ] + expected_results = [ ("POINT", Point), ("LINESTRING", LineString), ("POLYGON", Polygon), ("MULTIPOINT", MultiPoint), ("MULTILINESTRING", MultiLineString), ("MULTIPOLYGON", MultiPolygon), - } - - for geom_type, geom_class in expected_results: - with self.subTest(geom_type=geom_type): + ] + for test_feature, (geom_type, geom_class) in zip( + test_features, expected_results, strict=True + ): + with self.subTest(geom_type=geom_type, geom=test_feature.geom.wkt): + test_feature.save() obj = ( Feature.objects.annotate( geometry_type=functions.GeometryType("geom") From 5a2490a19d81f6f2666dd90ce79e5724b9a20a39 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 15 Oct 2025 13:57:09 +0200 Subject: [PATCH 2/3] Skipped GISFunctionsTests.test_geometry_type() test for MultiPoint on MariaDB and GEOS 3.12+. GEOSWKTWriter_write() behavior was changed in GEOS 3.12+ to include parentheses for sub-members (https://github.com/libgeos/geos/pull/903). MariaDB doesn't accept WKT representations with additional parentheses for MultiPoint. This is an accepted bug (MDEV-36166) in MariaDB that should be fixed in the future: - https://jira.mariadb.org/browse/MDEV-36166 --- tests/gis_tests/geoapp/test_functions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index 6a0f3e1f343a..917e63cd5762 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -14,6 +14,7 @@ Polygon, fromstr, ) +from django.contrib.gis.geos.libgeos import geos_version_tuple from django.contrib.gis.measure import Area from django.db import NotSupportedError, connection from django.db.models import IntegerField, Sum, Value @@ -920,7 +921,6 @@ def test_geometry_type(self): Feature(name="Point", geom=Point(0, 0)), Feature(name="LineString", geom=LineString((0, 0), (1, 1))), Feature(name="Polygon", geom=Polygon(((0, 0), (1, 0), (1, 1), (0, 0)))), - Feature(name="MultiPoint", geom=MultiPoint(Point(0, 0), Point(1, 1))), Feature( name="MultiLineString", geom=MultiLineString( @@ -939,10 +939,19 @@ def test_geometry_type(self): ("POINT", Point), ("LINESTRING", LineString), ("POLYGON", Polygon), - ("MULTIPOINT", MultiPoint), ("MULTILINESTRING", MultiLineString), ("MULTIPOLYGON", MultiPolygon), ] + # GEOSWKTWriter_write() behavior was changed in GEOS 3.12+ to include + # parentheses for sub-members. MariaDB doesn't accept WKT + # representations with additional parentheses for MultiPoint. This is + # an accepted bug (MDEV-36166) in MariaDB that should be fixed in the + # future. + if not connection.ops.mariadb or geos_version_tuple() < (3, 12): + test_features.append( + Feature(name="MultiPoint", geom=MultiPoint(Point(0, 0), Point(1, 1))) + ) + expected_results.append(("MULTIPOINT", MultiPoint)) for test_feature, (geom_type, geom_class) in zip( test_features, expected_results, strict=True ): From 2b62951fecf0024ce9ce0ce9f5be512c10747c0d Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Tue, 14 Oct 2025 17:13:05 +0200 Subject: [PATCH 3/3] Fixed #36659 -- Fixed flatpage content selector in admin forms.css. Regression in bb145e2c47d71b7f68280c00ced727442d2effa2. --- django/contrib/admin/static/admin/css/forms.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/admin/static/admin/css/forms.css b/django/contrib/admin/static/admin/css/forms.css index 33f370eaba1d..76e2d493e9dd 100644 --- a/django/contrib/admin/static/admin/css/forms.css +++ b/django/contrib/admin/static/admin/css/forms.css @@ -357,7 +357,7 @@ body.popup .submit-row { width: 48em; } -.flatpages-flatpage #id_content { +.app-flatpages.model-flatpage #id_content { height: 40.2em; }