summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2013-07-09 20:33:01 +0200
committerClaude Paroz <claude@2xlibre.net>2013-07-09 20:37:01 +0200
commit6157192b6e15ca94734e56be6c71a4154c6015bd (patch)
tree56e119b0b83889040b591d3c9a75a6bd66458edc
parentb96f3043a69bec4803d0c5cd84d3107c1ea94fa5 (diff)
Added a test for the envelope() GeoQuerySet method
Refs #20718.
-rw-r--r--django/contrib/gis/tests/geoapp/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
index 6badf2702d..eabc5958c0 100644
--- a/django/contrib/gis/tests/geoapp/tests.py
+++ b/django/contrib/gis/tests/geoapp/tests.py
@@ -433,6 +433,13 @@ class GeoQuerySetTest(TestCase):
self.assertEqual(c.mpoly.sym_difference(geom), c.sym_difference)
self.assertEqual(c.mpoly.union(geom), c.union)
+ @skipUnless(getattr(connection.ops, 'envelope', False), 'Database does not support envelope operation')
+ def test_envelope(self):
+ "Testing the `envelope` GeoQuerySet method."
+ countries = Country.objects.all().envelope()
+ for country in countries:
+ self.assertIsInstance(country.envelope, Polygon)
+
@no_mysql
@no_spatialite # SpatiaLite does not have an Extent function
def test_extent(self):