From d47de2e09d12636e5d527136b97f084da990c04f Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Tue, 28 Mar 2017 07:20:18 +0500 Subject: Refs #27736 -- Used decorators for GIS lookup registration. --- tests/gis_tests/rasterapp/test_rasterfield.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests') 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 [ -- cgit v1.3