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:
parent
acfc49ed4e
commit
b4a687b189
@ -49,8 +49,9 @@ class RelatedGeoModelTest(unittest.TestCase):
|
||||
self.assertAlmostEqual(ref.y, pnt.y, tol)
|
||||
|
||||
# Turning on debug so we can manually verify the number of SQL queries issued.
|
||||
dbg = settings.DEBUG
|
||||
settings.DEBUG = True
|
||||
# DISABLED: the number of queries count testing mechanism is way too brittle.
|
||||
#dbg = settings.DEBUG
|
||||
#settings.DEBUG = True
|
||||
from django.db import connection
|
||||
|
||||
# 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.
|
||||
qs = list(City.objects.filter(name=name).transform('location__point', srid))
|
||||
check_pnt(GEOSGeometry(wkt), qs[0].location.point)
|
||||
settings.DEBUG= dbg
|
||||
#settings.DEBUG= dbg
|
||||
|
||||
# Verifying the number of issued SQL queries.
|
||||
self.assertEqual(nqueries, len(connection.queries))
|
||||
#self.assertEqual(nqueries, len(connection.queries))
|
||||
|
||||
def suite():
|
||||
s = unittest.TestSuite()
|
||||
|
Loading…
x
Reference in New Issue
Block a user