diff options
| author | Justin Bronn <jbronn@gmail.com> | 2012-10-05 14:47:04 -0700 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2012-10-05 14:47:04 -0700 |
| commit | db78086b4540f968620ffe465174d7094267f04b (patch) | |
| tree | 26d7072af5ab2930fcae867b1fcbe6119caedc1b | |
| parent | 950e6183c60d368c62f627eaed54961be0a207d8 (diff) | |
Added comment in `geoapp` tests about PostGIS 2.0 change in ST_NumGeometries.
| -rw-r--r-- | django/contrib/gis/tests/geoapp/tests.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index 7d8121425a..1712eb5fe8 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -575,10 +575,13 @@ class GeoQuerySetTest(TestCase): def test_num_geom(self): "Testing the `num_geom` GeoQuerySet method." # Both 'countries' only have two geometries. - for c in Country.objects.num_geom(): self.assertEqual(2, c.num_geom) + for c in Country.objects.num_geom(): + self.assertEqual(2, c.num_geom) + for c in City.objects.filter(point__isnull=False).num_geom(): - # Oracle will return 1 for the number of geometries on non-collections, - # whereas PostGIS will return None. + # Oracle and PostGIS 2.0+ will return 1 for the number of + # geometries on non-collections, whereas PostGIS < 2.0.0 + # will return None. if postgis and connection.ops.spatial_version < (2, 0, 0): self.assertIsNone(c.num_geom) else: |
