summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2010-10-09 16:51:50 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2010-10-09 16:51:50 +0000
commitb3e02d19ecf0be17fa18db553be3e7d4734df60e (patch)
treed9793ea93e3d0fb0b3c03eef8af56d7cc43be9e3
parentbb66cb8463190a0d65b920f44f50c23da9f58bd7 (diff)
[1.2.X] Fixed #14011 -- Doing a subquery with __in and an EmptyQuerySet no longer raises an Exception. This is actually just a test for this, it was fixed by [14085]. Thanks to skatei for the report and mk for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14087 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/queries/tests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py
index 75653fc660..ab5369246d 100644
--- a/tests/regressiontests/queries/tests.py
+++ b/tests/regressiontests/queries/tests.py
@@ -87,3 +87,8 @@ class EmptyQuerySetTests(TestCase):
def test_emptyqueryset_values(self):
"#14366 -- calling .values() on an EmptyQuerySet and then cloning that should not cause an error"
self.assertEqual(list(Number.objects.none().values('num').order_by('num')), [])
+
+ def test_values_subquery(self):
+ self.assertQuerysetEqual(
+ Number.objects.filter(pk__in=Number.objects.none().values("pk")), []
+ )