summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-03-28 07:20:18 +0500
committerTim Graham <timograham@gmail.com>2017-03-27 22:20:18 -0400
commitd47de2e09d12636e5d527136b97f084da990c04f (patch)
treecb759d8acb7c47de4852b1995507879db3dd5abd /tests
parent24d53786d414586bb56243758cec41e802e8947d (diff)
Refs #27736 -- Used decorators for GIS lookup registration.
Diffstat (limited to 'tests')
-rw-r--r--tests/gis_tests/rasterapp/test_rasterfield.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/gis_tests/rasterapp/test_rasterfield.py b/tests/gis_tests/rasterapp/test_rasterfield.py
index e0a7ff2a5a..975b68cab0 100644
--- a/tests/gis_tests/rasterapp/test_rasterfield.py
+++ b/tests/gis_tests/rasterapp/test_rasterfield.py
@@ -1,9 +1,8 @@
import json
+from django.contrib.gis.db.models.fields import BaseSpatialField
from django.contrib.gis.db.models.functions import Distance
-from django.contrib.gis.db.models.lookups import (
- DistanceLookupBase, gis_lookups,
-)
+from django.contrib.gis.db.models.lookups import DistanceLookupBase, GISLookup
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.contrib.gis.measure import D
@@ -130,7 +129,9 @@ class RasterFieldTest(TransactionTestCase):
stx_pnt.transform(3086)
# Loop through all the GIS lookups.
- for name, lookup in gis_lookups.items():
+ for name, lookup in BaseSpatialField.get_lookups().items():
+ if not isinstance(lookup, GISLookup):
+ continue
# Construct lookup filter strings.
combo_keys = [
field + name for field in [