From 1906cb93609ce6042f97939a04067a122f5719a6 Mon Sep 17 00:00:00 2001
From: Aymeric Augustin <aymeric.augustin@m4x.org>
Date: Thu, 9 May 2013 17:38:47 +0200
Subject: [PATCH] Fixed conditional skipping of test for left/right lookup
 types.

connection.ops.spatial_version is None for some backends (eg. MySQL) and
the comparison fails on Python 3 with TypeError.
---
 django/contrib/gis/tests/geoapp/tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py
index a5164d39d1..672d78c1dd 100644
--- a/django/contrib/gis/tests/geoapp/tests.py
+++ b/django/contrib/gis/tests/geoapp/tests.py
@@ -297,7 +297,7 @@ class GeoLookupTest(TestCase):
 
     # The left/right lookup tests are known failures on PostGIS 2.0/2.0.1
     # http://trac.osgeo.org/postgis/ticket/2035
-    if (2, 0, 0) <= connection.ops.spatial_version <= (2, 0, 1):
+    if connection.ops.postgis and (2, 0, 0) <= connection.ops.spatial_version <= (2, 0, 1):
         test_left_right_lookups = unittest.expectedFailure(test_left_right_lookups)
 
     def test_equals_lookups(self):