Skip to content

Commit 8905372

Browse files
committed
Made runtests.py run gis_tests only when using a GIS database backend.
This facilitates other changes like refs #28160.
1 parent ec05ff0 commit 8905372

File tree

27 files changed

+31
-91
lines changed

27 files changed

+31
-91
lines changed

tests/gis_tests/distapp/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class NamedModel(models.Model):
88

99
class Meta:
1010
abstract = True
11-
required_db_features = ['gis_enabled']
1211

1312
def __str__(self):
1413
return self.name

tests/gis_tests/distapp/tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
)
1515

1616

17-
@skipUnlessDBFeature("gis_enabled")
1817
class DistanceTest(TestCase):
1918
fixtures = ['initial']
2019

@@ -238,7 +237,6 @@ def test_distance_lookups_with_expression_rhs(self):
238237
''' # NOQA
239238

240239

241-
@skipUnlessDBFeature("gis_enabled")
242240
class DistanceFunctionsTests(TestCase):
243241
fixtures = ['initial']
244242

tests/gis_tests/geo3d/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ class NamedModel(models.Model):
66

77
class Meta:
88
abstract = True
9-
required_db_features = ['gis_enabled']
109

1110
def __str__(self):
1211
return self.name
@@ -45,7 +44,6 @@ class SimpleModel(models.Model):
4544

4645
class Meta:
4746
abstract = True
48-
required_db_features = ['gis_enabled']
4947

5048

5149
class Point2D(SimpleModel):

tests/gis_tests/geo3d/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _load_polygon_data(self):
9393
Polygon3D.objects.create(name='3D BBox', poly=bbox_3d)
9494

9595

96-
@skipUnlessDBFeature("gis_enabled", "supports_3d_storage")
96+
@skipUnlessDBFeature("supports_3d_storage")
9797
class Geo3DTest(Geo3DLoadingHelper, TestCase):
9898
"""
9999
Only a subset of the PostGIS routines are 3D-enabled, and this TestCase
@@ -204,7 +204,7 @@ def check_extent3d(extent3d, tol=6):
204204
self.assertIsNone(City3D.objects.none().aggregate(Extent3D('point'))['point__extent3d'])
205205

206206

207-
@skipUnlessDBFeature("gis_enabled", "supports_3d_functions")
207+
@skipUnlessDBFeature("supports_3d_functions")
208208
class Geo3DFunctionsTests(Geo3DLoadingHelper, TestCase):
209209
def test_kml(self):
210210
"""

tests/gis_tests/geoadmin/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ class City(models.Model):
99

1010
class Meta:
1111
app_label = 'geoadmin'
12-
required_db_features = ['gis_enabled']
1312

1413
def __str__(self):
1514
return self.name

tests/gis_tests/geoadmin/tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
from django.contrib.gis import admin
22
from django.contrib.gis.geos import Point
3-
from django.test import TestCase, override_settings, skipUnlessDBFeature
3+
from django.test import TestCase, override_settings
44
from django.test.utils import patch_logger
55

66
from .admin import UnmodifiableAdmin
77
from .models import City, site
88

99

10-
@skipUnlessDBFeature("gis_enabled")
1110
@override_settings(ROOT_URLCONF='django.contrib.gis.tests.geoadmin.urls')
1211
class GeoAdminTest(TestCase):
1312

tests/gis_tests/geoapp/models.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class NamedModel(models.Model):
88

99
class Meta:
1010
abstract = True
11-
required_db_features = ['gis_enabled']
1211

1312
def __str__(self):
1413
return self.name
@@ -27,7 +26,6 @@ class City(NamedModel):
2726

2827
class Meta:
2928
app_label = 'geoapp'
30-
required_db_features = ['gis_enabled']
3129

3230

3331
# This is an inherited model from City
@@ -37,15 +35,13 @@ class PennsylvaniaCity(City):
3735

3836
class Meta:
3937
app_label = 'geoapp'
40-
required_db_features = ['gis_enabled']
4138

4239

4340
class State(NamedModel):
4441
poly = models.PolygonField(null=gisfield_may_be_null) # Allowing NULL geometries here.
4542

4643
class Meta:
4744
app_label = 'geoapp'
48-
required_db_features = ['gis_enabled']
4945

5046

5147
class Track(NamedModel):
@@ -57,25 +53,19 @@ class MultiFields(NamedModel):
5753
point = models.PointField()
5854
poly = models.PolygonField()
5955

60-
class Meta:
61-
required_db_features = ['gis_enabled']
62-
6356

6457
class UniqueTogetherModel(models.Model):
6558
city = models.CharField(max_length=30)
6659
point = models.PointField()
6760

6861
class Meta:
6962
unique_together = ('city', 'point')
70-
required_db_features = ['gis_enabled', 'supports_geometry_field_unique_index']
63+
required_db_features = ['supports_geometry_field_unique_index']
7164

7265

7366
class Truth(models.Model):
7467
val = models.BooleanField(default=False)
7568

76-
class Meta:
77-
required_db_features = ['gis_enabled']
78-
7969

8070
class Feature(NamedModel):
8171
geom = models.GeometryField()
@@ -84,9 +74,6 @@ class Feature(NamedModel):
8474
class MinusOneSRID(models.Model):
8575
geom = models.PointField(srid=-1) # Minus one SRID.
8676

87-
class Meta:
88-
required_db_features = ['gis_enabled']
89-
9077

9178
class NonConcreteField(models.IntegerField):
9279

tests/gis_tests/geoapp/test_expressions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from .models import City, ManyPointModel
1010

1111

12-
@skipUnlessDBFeature('gis_enabled')
1312
class GeoExpressionsTests(TestCase):
1413
fixtures = ['initial']
1514

tests/gis_tests/geoapp/test_feeds.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33
from django.conf import settings
44
from django.contrib.sites.models import Site
5-
from django.test import (
6-
TestCase, modify_settings, override_settings, skipUnlessDBFeature,
7-
)
5+
from django.test import TestCase, modify_settings, override_settings
86

97
from .models import City
108

119

1210
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.sites'})
1311
@override_settings(ROOT_URLCONF='gis_tests.geoapp.urls')
14-
@skipUnlessDBFeature("gis_enabled")
1512
class GeoFeedTest(TestCase):
1613
fixtures = ['initial']
1714

tests/gis_tests/geoapp/test_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from .models import City, Country, CountryWebMercator, State, Track
1717

1818

19-
@skipUnlessDBFeature("gis_enabled")
2019
class GISFunctionsTests(TestCase):
2120
"""
2221
Testing functions from django/contrib/gis/db/models/functions.py.

0 commit comments

Comments
 (0)