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. 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 The field name must be that of a geographic field.
must be that of a geographic field.
""" """
placemarks = [] placemarks = []
try: try:

View File

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

View File

@ -9,8 +9,6 @@ class City(models.Model):
name = models.CharField(max_length=30) name = models.CharField(max_length=30)
point = models.PointField() point = models.PointField()
objects = models.GeoManager()
class Meta: class Meta:
app_label = 'geoadmin' app_label = 'geoadmin'
required_db_features = ['gis_enabled'] required_db_features = ['gis_enabled']

View File

@ -39,10 +39,6 @@ class PennsylvaniaCity(City):
county = models.CharField(max_length=30) county = models.CharField(max_length=30)
founded = models.DateTimeField(null=True) founded = models.DateTimeField(null=True)
# TODO: This should be implicitly inherited.
objects = models.GeoManager()
class Meta: class Meta:
app_label = 'geoapp' app_label = 'geoapp'
required_db_features = ['gis_enabled'] required_db_features = ['gis_enabled']
@ -81,8 +77,6 @@ class UniqueTogetherModel(models.Model):
class Truth(models.Model): class Truth(models.Model):
val = models.BooleanField(default=False) val = models.BooleanField(default=False)
objects = models.GeoManager()
class Meta: class Meta:
required_db_features = ['gis_enabled'] required_db_features = ['gis_enabled']
@ -94,8 +88,6 @@ class Feature(NamedModel):
class MinusOneSRID(models.Model): class MinusOneSRID(models.Model):
geom = models.PointField(srid=-1) # Minus one SRID. geom = models.PointField(srid=-1) # Minus one SRID.
objects = models.GeoManager()
class Meta: class Meta:
required_db_features = ['gis_enabled'] required_db_features = ['gis_enabled']

View File

@ -13,8 +13,6 @@ class AllOGRFields(models.Model):
geom = models.PolygonField() geom = models.PolygonField()
point = models.PointField() point = models.PointField()
objects = models.GeoManager()
class Meta: class Meta:
required_db_features = ['gis_enabled'] required_db_features = ['gis_enabled']
@ -24,7 +22,5 @@ class Fields3D(models.Model):
line = models.LineStringField(dim=3) line = models.LineStringField(dim=3)
poly = models.PolygonField(dim=3) poly = models.PolygonField(dim=3)
objects = models.GeoManager()
class Meta: class Meta:
required_db_features = ['gis_enabled'] required_db_features = ['gis_enabled']

View File

@ -7,8 +7,6 @@ from ..models import models
class NamedModel(models.Model): class NamedModel(models.Model):
name = models.CharField(max_length=25) name = models.CharField(max_length=25)
objects = models.GeoManager()
class Meta: class Meta:
abstract = True abstract = True
required_db_features = ['gis_enabled'] required_db_features = ['gis_enabled']

View File

@ -13,7 +13,6 @@ try:
# raised if GDAL isn't installed. # raised if GDAL isn't installed.
models.OriginalRasterField = models.RasterField models.OriginalRasterField = models.RasterField
except ImproperlyConfigured: except ImproperlyConfigured:
models.GeoManager = models.Manager
models.GeometryField = DummyField models.GeometryField = DummyField
models.LineStringField = DummyField models.LineStringField = DummyField
models.MultiPointField = DummyField models.MultiPointField = DummyField

View File

@ -33,8 +33,6 @@ class City(SimpleModel):
class AugmentedLocation(Location): class AugmentedLocation(Location):
extra_text = models.TextField(blank=True) extra_text = models.TextField(blank=True)
objects = models.GeoManager()
class DirectoryEntry(SimpleModel): class DirectoryEntry(SimpleModel):
listing_text = models.CharField(max_length=50) listing_text = models.CharField(max_length=50)
@ -55,7 +53,6 @@ class Parcel(SimpleModel):
return self.name return self.name
# These use the GeoManager but do not have any geographic fields.
class Author(SimpleModel): class Author(SimpleModel):
name = models.CharField(max_length=100) name = models.CharField(max_length=100)
dob = models.DateField() 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 # ORA-22901: cannot compare nested table or VARRAY or LOB attributes of an object type
@no_oracle @no_oracle
def test12a_count(self): 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. # The City, 'Fort Worth' uses the same location as Dallas.
dallas = City.objects.get(name='Dallas') dallas = City.objects.get(name='Dallas')
@ -259,7 +259,7 @@ class RelatedGeoModelTest(TestCase):
self.assertEqual(2, loc.num_cities) self.assertEqual(2, loc.num_cities)
def test12b_count(self): 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 # Should only be one author (Trevor Paglen) returned by this query, and
# the annotation should have 3 for the number of books, see #11087. # the annotation should have 3 for the number of books, see #11087.
# Also testing with a values(), see #11489. # Also testing with a values(), see #11489.
@ -284,7 +284,7 @@ class RelatedGeoModelTest(TestCase):
# TODO: The phantom model does appear on Oracle. # TODO: The phantom model does appear on Oracle.
@no_oracle @no_oracle
def test13_select_related_null_fk(self): 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') Book.objects.create(title='Without Author')
b = Book.objects.select_related('author').get(title='Without Author') b = Book.objects.select_related('author').get(title='Without Author')
# Should be `None`, and not a 'dummy' model. # Should be `None`, and not a 'dummy' model.