mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
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
This commit is contained in:
@@ -14,6 +14,7 @@ from django.contrib.gis.geos import (
|
|||||||
Polygon,
|
Polygon,
|
||||||
fromstr,
|
fromstr,
|
||||||
)
|
)
|
||||||
|
from django.contrib.gis.geos.libgeos import geos_version_tuple
|
||||||
from django.contrib.gis.measure import Area
|
from django.contrib.gis.measure import Area
|
||||||
from django.db import NotSupportedError, connection
|
from django.db import NotSupportedError, connection
|
||||||
from django.db.models import IntegerField, Sum, Value
|
from django.db.models import IntegerField, Sum, Value
|
||||||
@@ -908,7 +909,6 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
|||||||
Feature(name="Point", geom=Point(0, 0)),
|
Feature(name="Point", geom=Point(0, 0)),
|
||||||
Feature(name="LineString", geom=LineString((0, 0), (1, 1))),
|
Feature(name="LineString", geom=LineString((0, 0), (1, 1))),
|
||||||
Feature(name="Polygon", geom=Polygon(((0, 0), (1, 0), (1, 1), (0, 0)))),
|
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(
|
Feature(
|
||||||
name="MultiLineString",
|
name="MultiLineString",
|
||||||
geom=MultiLineString(
|
geom=MultiLineString(
|
||||||
@@ -927,10 +927,19 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
|
|||||||
("POINT", Point),
|
("POINT", Point),
|
||||||
("LINESTRING", LineString),
|
("LINESTRING", LineString),
|
||||||
("POLYGON", Polygon),
|
("POLYGON", Polygon),
|
||||||
("MULTIPOINT", MultiPoint),
|
|
||||||
("MULTILINESTRING", MultiLineString),
|
("MULTILINESTRING", MultiLineString),
|
||||||
("MULTIPOLYGON", MultiPolygon),
|
("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(
|
for test_feature, (geom_type, geom_class) in zip(
|
||||||
test_features, expected_results, strict=True
|
test_features, expected_results, strict=True
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user