summaryrefslogtreecommitdiff
path: root/django/contrib/gis/tests/relatedapp/tests.py
diff options
context:
space:
mode:
authorArthur Koziel <arthur@arthurkoziel.com>2010-09-13 00:04:27 +0000
committerArthur Koziel <arthur@arthurkoziel.com>2010-09-13 00:04:27 +0000
commitdd49269c7db008b2567f50cb03c4d3d9b321daa1 (patch)
tree326dd25bb045ac016cda7966b43cbdfe1f67d699 /django/contrib/gis/tests/relatedapp/tests.py
parentc9b188c4ec939abbe48dae5a371276742e64b6b8 (diff)
downloaddjango-soc2010/app-loading.tar.gz
[soc2010/app-loading] merged trunkarchive/soc2010/app-loadingsoc2010/app-loading
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/app-loading@13818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/gis/tests/relatedapp/tests.py')
-rw-r--r--django/contrib/gis/tests/relatedapp/tests.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/django/contrib/gis/tests/relatedapp/tests.py b/django/contrib/gis/tests/relatedapp/tests.py
index 184b65b9c7..5d3d00f08d 100644
--- a/django/contrib/gis/tests/relatedapp/tests.py
+++ b/django/contrib/gis/tests/relatedapp/tests.py
@@ -4,7 +4,7 @@ from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, oracle, postgis, spatialite, no_mysql, no_oracle, no_spatialite
from django.conf import settings
-from models import City, Location, DirectoryEntry, Parcel, Book, Author
+from models import City, Location, DirectoryEntry, Parcel, Book, Author, Article
cities = (('Aurora', 'TX', -97.516111, 33.058333),
('Roswell', 'NM', -104.528056, 33.387222),
@@ -291,6 +291,14 @@ class RelatedGeoModelTest(unittest.TestCase):
self.assertEqual(4, len(coll))
self.assertEqual(ref_geom, coll)
+ def test15_invalid_select_related(self):
+ "Testing doing select_related on the related name manager of a unique FK. See #13934."
+ qs = Article.objects.select_related('author__article')
+ # This triggers TypeError when `get_default_columns` has no `local_only`
+ # keyword. The TypeError is swallowed if QuerySet is actually
+ # evaluated as list generation swallows TypeError in CPython.
+ sql = str(qs.query)
+
# TODO: Related tests for KML, GML, and distance lookups.
def suite():