1
0
mirror of https://github.com/django/django.git synced 2025-07-04 01:39:20 +00:00

gis: Disabled query counting test in relatedapp because of its brittleness (number of queries may depend on external factors).

git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7572 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2008-06-04 17:25:55 +00:00
parent acfc49ed4e
commit b4a687b189

View File

@ -49,8 +49,9 @@ class RelatedGeoModelTest(unittest.TestCase):
self.assertAlmostEqual(ref.y, pnt.y, tol) self.assertAlmostEqual(ref.y, pnt.y, tol)
# Turning on debug so we can manually verify the number of SQL queries issued. # Turning on debug so we can manually verify the number of SQL queries issued.
dbg = settings.DEBUG # DISABLED: the number of queries count testing mechanism is way too brittle.
settings.DEBUG = True #dbg = settings.DEBUG
#settings.DEBUG = True
from django.db import connection from django.db import connection
# Each city transformed to the SRID of their state plane coordinate system. # Each city transformed to the SRID of their state plane coordinate system.
@ -63,10 +64,10 @@ class RelatedGeoModelTest(unittest.TestCase):
# Doing this implicitly sets `select_related` select the location. # Doing this implicitly sets `select_related` select the location.
qs = list(City.objects.filter(name=name).transform('location__point', srid)) qs = list(City.objects.filter(name=name).transform('location__point', srid))
check_pnt(GEOSGeometry(wkt), qs[0].location.point) check_pnt(GEOSGeometry(wkt), qs[0].location.point)
settings.DEBUG= dbg #settings.DEBUG= dbg
# Verifying the number of issued SQL queries. # Verifying the number of issued SQL queries.
self.assertEqual(nqueries, len(connection.queries)) #self.assertEqual(nqueries, len(connection.queries))
def suite(): def suite():
s = unittest.TestSuite() s = unittest.TestSuite()