Replaced DatabaseFeatures.supports_left_right_lookups with skipUnlessGISLookup.

This commit is contained in:
Tim Graham 2021-01-02 15:39:48 -05:00 committed by GitHub
parent 656b331b13
commit 060e6bdd1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 5 deletions

View File

@ -35,9 +35,6 @@ class BaseSpatialFeatures:
# Is the database able to count vertices on polygons (with `num_points`)? # Is the database able to count vertices on polygons (with `num_points`)?
supports_num_points_poly = True supports_num_points_poly = True
# The following properties indicate if the database backend support
# certain lookups (dwithin, left and right, relate, ...)
supports_left_right_lookups = False
# Does the backend support expressions for specifying distance in the # Does the backend support expressions for specifying distance in the
# dwithin lookup? # dwithin lookup?
supports_dwithin_distance_expr = True supports_dwithin_distance_expr = True

View File

@ -8,6 +8,5 @@ class DatabaseFeatures(BaseSpatialFeatures, Psycopg2DatabaseFeatures):
supports_geography = True supports_geography = True
supports_3d_storage = True supports_3d_storage = True
supports_3d_functions = True supports_3d_functions = True
supports_left_right_lookups = True
supports_raster = True supports_raster = True
supports_empty_geometries = True supports_empty_geometries = True

View File

@ -308,7 +308,7 @@ class GeoLookupTest(TestCase):
self.assertEqual(qs.filter(poly__isvalid=False).count(), 1) self.assertEqual(qs.filter(poly__isvalid=False).count(), 1)
self.assertEqual(qs.filter(poly__isvalid=True).count(), qs.count() - 1) self.assertEqual(qs.filter(poly__isvalid=True).count(), qs.count() - 1)
@skipUnlessDBFeature("supports_left_right_lookups") @skipUnlessGISLookup('left', 'right')
def test_left_right_lookups(self): def test_left_right_lookups(self):
"Testing the 'left' and 'right' lookup types." "Testing the 'left' and 'right' lookup types."
# Left: A << B => true if xmax(A) < xmin(B) # Left: A << B => true if xmax(A) < xmin(B)