summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2020-09-14 21:33:58 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-09-15 07:48:48 +0200
commitfed257ddff449e1bf1ce06d9a7fddb148290a6ac (patch)
tree93f8a5ed6ed312d863e24b6b4122ab4a582341fe /tests
parent7f2392981dab255286b2b042c758c098ec8582e2 (diff)
Prevented creation of 3D test models if not supported.
There's no problem creating the models on MySQL and Oracle (which don't support 3D storage) but CockroachDB currently crashes with a syntax error.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/geo3d/models.py18
-rw-r--r--tests/gis_tests/inspectapp/models.py3
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/gis_tests/geo3d/models.py b/tests/gis_tests/geo3d/models.py
index 2f3bb4419e..cd33a1da39 100644
--- a/tests/gis_tests/geo3d/models.py
+++ b/tests/gis_tests/geo3d/models.py
@@ -15,6 +15,9 @@ class City3D(NamedModel):
point = models.PointField(dim=3)
pointg = models.PointField(dim=3, geography=True)
+ class Meta:
+ required_db_features = {'supports_3d_storage'}
+
class Interstate2D(NamedModel):
line = models.LineStringField(srid=4269)
@@ -23,6 +26,9 @@ class Interstate2D(NamedModel):
class Interstate3D(NamedModel):
line = models.LineStringField(dim=3, srid=4269)
+ class Meta:
+ required_db_features = {'supports_3d_storage'}
+
class InterstateProj2D(NamedModel):
line = models.LineStringField(srid=32140)
@@ -31,6 +37,9 @@ class InterstateProj2D(NamedModel):
class InterstateProj3D(NamedModel):
line = models.LineStringField(dim=3, srid=32140)
+ class Meta:
+ required_db_features = {'supports_3d_storage'}
+
class Polygon2D(NamedModel):
poly = models.PolygonField(srid=32140)
@@ -39,6 +48,9 @@ class Polygon2D(NamedModel):
class Polygon3D(NamedModel):
poly = models.PolygonField(dim=3, srid=32140)
+ class Meta:
+ required_db_features = {'supports_3d_storage'}
+
class SimpleModel(models.Model):
@@ -53,6 +65,12 @@ class Point2D(SimpleModel):
class Point3D(SimpleModel):
point = models.PointField(dim=3)
+ class Meta:
+ required_db_features = {'supports_3d_storage'}
+
class MultiPoint3D(SimpleModel):
mpoint = models.MultiPointField(dim=3)
+
+ class Meta:
+ required_db_features = {'supports_3d_storage'}
diff --git a/tests/gis_tests/inspectapp/models.py b/tests/gis_tests/inspectapp/models.py
index 1c37579c0a..ca6566844e 100644
--- a/tests/gis_tests/inspectapp/models.py
+++ b/tests/gis_tests/inspectapp/models.py
@@ -19,3 +19,6 @@ class Fields3D(models.Model):
pointg = models.PointField(dim=3, geography=True)
line = models.LineStringField(dim=3)
poly = models.PolygonField(dim=3)
+
+ class Meta:
+ required_db_features = {'supports_3d_storage'}