mirror of
https://github.com/django/django.git
synced 2025-01-19 14:52:54 +00:00
Fixed #25400 -- Fixed regression in nonexistent features on gis backends.
This commit is contained in:
parent
8550161e53
commit
da5747f8e4
@ -98,9 +98,8 @@ class BaseSpatialFeatures(object):
|
|||||||
m = re.match(r'has_(\w*)_function$', name)
|
m = re.match(r'has_(\w*)_function$', name)
|
||||||
if m:
|
if m:
|
||||||
func_name = m.group(1)
|
func_name = m.group(1)
|
||||||
if func_name not in self.connection.ops.unsupported_functions:
|
return func_name not in self.connection.ops.unsupported_functions
|
||||||
return True
|
raise AttributeError
|
||||||
return False
|
|
||||||
|
|
||||||
def has_ops_method(self, method):
|
def has_ops_method(self, method):
|
||||||
return getattr(self.connection.ops, method, False)
|
return getattr(self.connection.ops, method, False)
|
||||||
|
8
tests/backends/test_features.py
Normal file
8
tests/backends/test_features.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from django.db import connection
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestDatabaseFeatures(TestCase):
|
||||||
|
|
||||||
|
def test_nonexistent_feature(self):
|
||||||
|
self.assertFalse(hasattr(connection.features, 'nonexistent'))
|
Loading…
x
Reference in New Issue
Block a user