1. Ian Struble
  2. django

Commits

Al...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 9b28a75

Added a test for using an `__in` lookup with a ValueListQueryset from a none() call. Refs #14622.

  • Participants
  • Parent commits 8f6b996
  • Branches default

Comments (0)

Files changed (1)

File tests/regressiontests/queries/tests.py

View file
  • Ignore whitespace
     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')), [])
+        self.assertQuerysetEqual(
+            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")),
             []
         )
+        self.assertQuerysetEqual(
+            Number.objects.filter(pk__in=Number.objects.none().values_list("pk")),
+            []
+        )
 
 
 class WeirdQuerysetSlicingTests(BaseQuerysetTest):