summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2010-09-12 02:09:17 +0000
committerJustin Bronn <jbronn@gmail.com>2010-09-12 02:09:17 +0000
commit31744a78cd8fe8b3c9878e8c2219fa63e0078e83 (patch)
tree636f2012d830882a1e672808f18ec6970da4876f
parent24586d4d866b35f0b236aa4d375dcd6928162840 (diff)
[1.2.X] Fixed #14060 -- PostGIS never implemented the `~=` operator for geography types, so removed support for it.
Backport of r13757 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13758 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/gis/db/backends/postgis/operations.py2
-rw-r--r--django/contrib/gis/tests/geogapp/tests.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py
index b1a9e31529..5affcf9a18 100644
--- a/django/contrib/gis/db/backends/postgis/operations.py
+++ b/django/contrib/gis/db/backends/postgis/operations.py
@@ -233,8 +233,6 @@ class PostGISOperations(DatabaseOperations, BaseSpatialOperations):
})
self.geography_operators = {
'bboverlaps' : PostGISOperator('&&'),
- 'exact' : PostGISOperator('~='),
- 'same_as' : PostGISOperator('~='),
}
# Creating a dictionary lookup of all GIS terms for PostGIS.
diff --git a/django/contrib/gis/tests/geogapp/tests.py b/django/contrib/gis/tests/geogapp/tests.py
index 7be5193103..3dea930afd 100644
--- a/django/contrib/gis/tests/geogapp/tests.py
+++ b/django/contrib/gis/tests/geogapp/tests.py
@@ -44,6 +44,10 @@ class GeographyTest(TestCase):
# `@` operator not available.
self.assertRaises(ValueError, City.objects.filter(point__contained=z.poly).count)
+ # Regression test for #14060, `~=` was never really implemented for PostGIS.
+ htown = City.objects.get(name='Houston')
+ self.assertRaises(ValueError, City.objects.get, point__exact=htown.point)
+
def test05_geography_layermapping(self):
"Testing LayerMapping support on models with geography fields."
# There is a similar test in `layermap` that uses the same data set,