mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[4.1.x] Fixed #33794 -- Fixed string-casting of GIS queries on PostgreSQL.
Regression in64c3f049ea. Backport ofde74a74b4bfrom main
This commit is contained in:
committed by
Mariusz Felisiak
parent
91b365ef67
commit
42e4b0e608
@@ -212,6 +212,14 @@ class GeoModelTest(TestCase):
|
||||
with self.assertNumQueries(0): # Ensure point isn't deferred.
|
||||
self.assertIsInstance(cities2[0].point, Point)
|
||||
|
||||
def test_gis_query_as_string(self):
|
||||
"""GIS queries can be represented as strings."""
|
||||
query = City.objects.filter(point__within=Polygon.from_bbox((0, 0, 2, 2)))
|
||||
self.assertIn(
|
||||
connection.ops.quote_name(City._meta.db_table),
|
||||
str(query.query),
|
||||
)
|
||||
|
||||
def test_dumpdata_loaddata_cycle(self):
|
||||
"""
|
||||
Test a dumpdata/loaddata cycle with geographic data.
|
||||
|
||||
Reference in New Issue
Block a user