Kaydet (Commit) 3234c7a1 authored tarafından Alex Gaynor's avatar Alex Gaynor

Fixed #14011 -- Doing a subquery with __in and an EmptyQuerySet no longer raises…

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 [14084].  Thanks to skatei for the report and mk for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 560fedde
...@@ -87,3 +87,8 @@ class EmptyQuerySetTests(TestCase): ...@@ -87,3 +87,8 @@ class EmptyQuerySetTests(TestCase):
def test_emptyqueryset_values(self): def test_emptyqueryset_values(self):
"#14366 -- calling .values() on an EmptyQuerySet and then cloning that should not cause an error" "#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')), []) 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")), []
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment