Loading django/contrib/gis/db/backends/base/features.py +2 −3 Original line number Diff line number Diff line Loading @@ -98,9 +98,8 @@ class BaseSpatialFeatures(object): m = re.match(r'has_(\w*)_function$', name) if m: func_name = m.group(1) if func_name not in self.connection.ops.unsupported_functions: return True return False return func_name not in self.connection.ops.unsupported_functions raise AttributeError def has_ops_method(self, method): return getattr(self.connection.ops, method, False) tests/backends/test_features.py 0 → 100644 +8 −0 Original line number Diff line number Diff line 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
django/contrib/gis/db/backends/base/features.py +2 −3 Original line number Diff line number Diff line Loading @@ -98,9 +98,8 @@ class BaseSpatialFeatures(object): m = re.match(r'has_(\w*)_function$', name) if m: func_name = m.group(1) if func_name not in self.connection.ops.unsupported_functions: return True return False return func_name not in self.connection.ops.unsupported_functions raise AttributeError def has_ops_method(self, method): return getattr(self.connection.ops, method, False)
tests/backends/test_features.py 0 → 100644 +8 −0 Original line number Diff line number Diff line from django.db import connection from django.test import TestCase class TestDatabaseFeatures(TestCase): def test_nonexistent_feature(self): self.assertFalse(hasattr(connection.features, 'nonexistent'))