From 9027fac8414c30db640c4592ee083f12bb8ee5a6 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 11 Mar 2016 12:53:12 -0500 Subject: [PATCH] Removed unneeded GeoManagers in tests. --- django/contrib/gis/sitemaps/views.py | 3 +-- tests/gis_tests/geo3d/models.py | 2 -- tests/gis_tests/geoadmin/models.py | 2 -- tests/gis_tests/geoapp/models.py | 8 -------- tests/gis_tests/inspectapp/models.py | 4 ---- tests/gis_tests/layermap/models.py | 2 -- tests/gis_tests/models.py | 1 - tests/gis_tests/relatedapp/models.py | 3 --- tests/gis_tests/relatedapp/tests.py | 6 +++--- 9 files changed, 4 insertions(+), 27 deletions(-) diff --git a/django/contrib/gis/sitemaps/views.py b/django/contrib/gis/sitemaps/views.py index c5fd1aa904..948c3ec36c 100644 --- a/django/contrib/gis/sitemaps/views.py +++ b/django/contrib/gis/sitemaps/views.py @@ -13,8 +13,7 @@ def kml(request, label, model, field_name=None, compress=False, using=DEFAULT_DB """ This view generates KML for the given app label, model, and field name. - The model's default manager must be GeoManager, and the field name - must be that of a geographic field. + The field name must be that of a geographic field. """ placemarks = [] try: diff --git a/tests/gis_tests/geo3d/models.py b/tests/gis_tests/geo3d/models.py index fb741ca05c..e816cb3dad 100644 --- a/tests/gis_tests/geo3d/models.py +++ b/tests/gis_tests/geo3d/models.py @@ -47,8 +47,6 @@ class Polygon3D(NamedModel): class SimpleModel(models.Model): - objects = models.GeoManager() - class Meta: abstract = True required_db_features = ['gis_enabled'] diff --git a/tests/gis_tests/geoadmin/models.py b/tests/gis_tests/geoadmin/models.py index 7c8ef9fbb2..3a9724789c 100644 --- a/tests/gis_tests/geoadmin/models.py +++ b/tests/gis_tests/geoadmin/models.py @@ -9,8 +9,6 @@ class City(models.Model): name = models.CharField(max_length=30) point = models.PointField() - objects = models.GeoManager() - class Meta: app_label = 'geoadmin' required_db_features = ['gis_enabled'] diff --git a/tests/gis_tests/geoapp/models.py b/tests/gis_tests/geoapp/models.py index 42a93356b6..764867d66f 100644 --- a/tests/gis_tests/geoapp/models.py +++ b/tests/gis_tests/geoapp/models.py @@ -39,10 +39,6 @@ class PennsylvaniaCity(City): county = models.CharField(max_length=30) founded = models.DateTimeField(null=True) - # TODO: This should be implicitly inherited. - - objects = models.GeoManager() - class Meta: app_label = 'geoapp' required_db_features = ['gis_enabled'] @@ -81,8 +77,6 @@ class UniqueTogetherModel(models.Model): class Truth(models.Model): val = models.BooleanField(default=False) - objects = models.GeoManager() - class Meta: required_db_features = ['gis_enabled'] @@ -94,8 +88,6 @@ class Feature(NamedModel): class MinusOneSRID(models.Model): geom = models.PointField(srid=-1) # Minus one SRID. - objects = models.GeoManager() - class Meta: required_db_features = ['gis_enabled'] diff --git a/tests/gis_tests/inspectapp/models.py b/tests/gis_tests/inspectapp/models.py index 75c4bcfa22..4936a0e704 100644 --- a/tests/gis_tests/inspectapp/models.py +++ b/tests/gis_tests/inspectapp/models.py @@ -13,8 +13,6 @@ class AllOGRFields(models.Model): geom = models.PolygonField() point = models.PointField() - objects = models.GeoManager() - class Meta: required_db_features = ['gis_enabled'] @@ -24,7 +22,5 @@ class Fields3D(models.Model): line = models.LineStringField(dim=3) poly = models.PolygonField(dim=3) - objects = models.GeoManager() - class Meta: required_db_features = ['gis_enabled'] diff --git a/tests/gis_tests/layermap/models.py b/tests/gis_tests/layermap/models.py index 3457e0e2d5..1e313049fb 100644 --- a/tests/gis_tests/layermap/models.py +++ b/tests/gis_tests/layermap/models.py @@ -7,8 +7,6 @@ from ..models import models class NamedModel(models.Model): name = models.CharField(max_length=25) - objects = models.GeoManager() - class Meta: abstract = True required_db_features = ['gis_enabled'] diff --git a/tests/gis_tests/models.py b/tests/gis_tests/models.py index c157258845..aaedf0f8a7 100644 --- a/tests/gis_tests/models.py +++ b/tests/gis_tests/models.py @@ -13,7 +13,6 @@ try: # raised if GDAL isn't installed. models.OriginalRasterField = models.RasterField except ImproperlyConfigured: - models.GeoManager = models.Manager models.GeometryField = DummyField models.LineStringField = DummyField models.MultiPointField = DummyField diff --git a/tests/gis_tests/relatedapp/models.py b/tests/gis_tests/relatedapp/models.py index 606b40c52a..0052e1797f 100644 --- a/tests/gis_tests/relatedapp/models.py +++ b/tests/gis_tests/relatedapp/models.py @@ -33,8 +33,6 @@ class City(SimpleModel): class AugmentedLocation(Location): extra_text = models.TextField(blank=True) - objects = models.GeoManager() - class DirectoryEntry(SimpleModel): listing_text = models.CharField(max_length=50) @@ -55,7 +53,6 @@ class Parcel(SimpleModel): return self.name -# These use the GeoManager but do not have any geographic fields. class Author(SimpleModel): name = models.CharField(max_length=100) dob = models.DateField() diff --git a/tests/gis_tests/relatedapp/tests.py b/tests/gis_tests/relatedapp/tests.py index d6950f7432..5fc693f3cf 100644 --- a/tests/gis_tests/relatedapp/tests.py +++ b/tests/gis_tests/relatedapp/tests.py @@ -250,7 +250,7 @@ class RelatedGeoModelTest(TestCase): # ORA-22901: cannot compare nested table or VARRAY or LOB attributes of an object type @no_oracle def test12a_count(self): - "Testing `Count` aggregate use with the `GeoManager` on geo-fields." + "Testing `Count` aggregate on geo-fields." # The City, 'Fort Worth' uses the same location as Dallas. dallas = City.objects.get(name='Dallas') @@ -259,7 +259,7 @@ class RelatedGeoModelTest(TestCase): self.assertEqual(2, loc.num_cities) def test12b_count(self): - "Testing `Count` aggregate use with the `GeoManager` on non geo-fields. See #11087." + "Testing `Count` aggregate on non geo-fields." # Should only be one author (Trevor Paglen) returned by this query, and # the annotation should have 3 for the number of books, see #11087. # Also testing with a values(), see #11489. @@ -284,7 +284,7 @@ class RelatedGeoModelTest(TestCase): # TODO: The phantom model does appear on Oracle. @no_oracle def test13_select_related_null_fk(self): - "Testing `select_related` on a nullable ForeignKey via `GeoManager`. See #11381." + "Testing `select_related` on a nullable ForeignKey." Book.objects.create(title='Without Author') b = Book.objects.select_related('author').get(title='Without Author') # Should be `None`, and not a 'dummy' model.