mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Removed redundant database vendor helpers in gis_tests/utils.py.
This commit is contained in:
parent
9f91122ed8
commit
e3ece0144a
12 changed files with 71 additions and 88 deletions
|
@ -1,12 +1,9 @@
|
|||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.db.models import F, GeometryField, Value, functions
|
||||
from django.contrib.gis.geos import Point, Polygon
|
||||
from django.db import connection
|
||||
from django.db.models import Count, Min
|
||||
from django.test import TestCase, skipUnlessDBFeature
|
||||
|
||||
from ..utils import postgis
|
||||
from .models import City, ManyPointModel, MultiFields
|
||||
|
||||
|
||||
|
@ -25,7 +22,7 @@ class GeoExpressionsTests(TestCase):
|
|||
self.assertTrue(point.equals_exact(p.transform(4326, clone=True), 10 ** -5))
|
||||
self.assertEqual(point.srid, 4326)
|
||||
|
||||
@skipUnless(postgis, 'Only postgis has geography fields.')
|
||||
@skipUnlessDBFeature('supports_geography')
|
||||
def test_geography_value(self):
|
||||
p = Polygon(((1, 1), (1, 2), (2, 2), (2, 1), (1, 1)))
|
||||
area = City.objects.annotate(a=functions.Area(Value(p, GeometryField(srid=4326, geography=True)))).first().a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue