From 2e00119e397dd30d20723861a495d872886685c7 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 12 Jun 2019 08:32:02 +0200 Subject: [PATCH] Fixed GISFunctionsTests.test_asgeojson() crash on MariaDB 10.2+. --- tests/gis_tests/geoapp/test_functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index 4f8cc9e712..f223599ede 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -85,6 +85,9 @@ class GISFunctionsTests(FuncTestMixin, TestCase): # SELECT ST_AsGeoJson("geoapp_city"."point", 5, 3) FROM "geoapp_city" # WHERE "geoapp_city"."name" = 'Chicago'; # Finally, we set every available keyword. + # MariaDB doesn't limit the number of decimals in bbox. + if mysql and connection.mysql_is_mariadb: + chicago_json['bbox'] = [-87.650175, 41.850385, -87.650175, 41.850385] self.assertJSONEqual( City.objects.annotate( geojson=functions.AsGeoJSON('point', bbox=True, crs=True, precision=5)