1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Removed redundant database vendor helpers in gis_tests/utils.py.

This commit is contained in:
Tim Graham
2020-11-14 09:08:30 -05:00
committed by Mariusz Felisiak
parent 9f91122ed8
commit e3ece0144a
12 changed files with 71 additions and 88 deletions

View File

@@ -10,8 +10,6 @@ from django.test import (
TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature,
)
from ..utils import mysql, oracle
try:
GeometryColumns = connection.ops.geometry_columns()
HAS_GEOMETRY_COLUMNS = True
@@ -30,7 +28,7 @@ class OperationTestCase(TransactionTestCase):
@property
def has_spatial_indexes(self):
if mysql:
if connection.ops.mysql:
with connection.cursor() as cursor:
return connection.introspection.supports_spatial_index(cursor, 'gis_neighborhood')
return True
@@ -120,7 +118,7 @@ class OperationTests(OperationTestCase):
def test_geom_col_name(self):
self.assertEqual(
GeometryColumns.geom_col_name(),
'column_name' if oracle else 'f_geometry_column',
'column_name' if connection.ops.oracle else 'f_geometry_column',
)
@skipUnlessDBFeature('supports_raster')