1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Removed unneeded GeoManagers in tests.

This commit is contained in:
Tim Graham 2016-03-11 12:53:12 -05:00
parent 1f035e6283
commit 9027fac841
9 changed files with 4 additions and 27 deletions

View File

@ -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:

View File

@ -47,8 +47,6 @@ class Polygon3D(NamedModel):
class SimpleModel(models.Model):
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']

View File

@ -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']

View File

@ -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']

View File

@ -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']

View File

@ -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']

View File

@ -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

View File

@ -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()

View File

@ -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.