1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Refs #14357 -- Deprecated Meta.ordering affecting GROUP BY queries.

Thanks Ramiro Morales for contributing to the patch.
This commit is contained in:
Ramiro Morales
2018-09-13 13:29:48 -03:00
committed by Tim Graham
parent c52ecbda61
commit 1b1f64ee5a
9 changed files with 80 additions and 16 deletions

View File

@@ -1156,7 +1156,7 @@ class Queries1Tests(TestCase):
def test_ticket_20250(self):
# A negated Q along with an annotated queryset failed in Django 1.4
qs = Author.objects.annotate(Count('item'))
qs = qs.filter(~Q(extra__value=0))
qs = qs.filter(~Q(extra__value=0)).order_by('name')
self.assertIn('SELECT', str(qs.query))
self.assertQuerysetEqual(