#35643: Regression in Queryset sequence of value, annotate, order, value
-------------------------------------+-------------------------------------
     Reporter:  Gert Van Gool        |                     Type:  Bug
       Status:  new                  |                Component:  Database
                                     |  layer (models, ORM)
      Version:  5.1                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Testing the 5.1RC on our project, I noticed a failure in a queryset that
 worked before (Django 5.0.7)

 I've added a test case:


 {{{
 diff --git i/tests/queries/tests.py w/tests/queries/tests.py
 index 7ac8a65d42..c19d877ffc 100644
 --- i/tests/queries/tests.py
 +++ w/tests/queries/tests.py
 @@ -1375,6 +1375,16 @@ class Queries1Tests(TestCase):
          self.assertCountEqual(items_after, [self.i2, self.i3, self.i4])
          self.assertCountEqual(items_before, items_after)

 +    def test_values_count_value(self):
 +        self.assertSequenceEqual(
 +            Tag.objects.all()
 +            .values("category")
 +            .annotate(Count("category"))
 +            .order_by("-category__count")
 +            .values_list("category", flat=True),
 +            [self.nc1.id, None],
 +        )
 +

  class Queries2Tests(TestCase):
      @classmethod
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35643>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070191048d88d7-2ec64f04-18a7-43f6-90f4-f226ee218256-000000%40eu-central-1.amazonses.com.

Reply via email to