summaryrefslogtreecommitdiff
path: root/tests/gis_tests/geoapp/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gis_tests/geoapp/tests.py')
-rw-r--r--tests/gis_tests/geoapp/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/gis_tests/geoapp/tests.py b/tests/gis_tests/geoapp/tests.py
index 0a71639c84..fd5fc3c793 100644
--- a/tests/gis_tests/geoapp/tests.py
+++ b/tests/gis_tests/geoapp/tests.py
@@ -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.