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

Fixed #27632 -- Unified query parameters by their values on Oracle.

This commit is contained in:
Mariusz Felisiak
2016-12-24 13:26:15 +01:00
committed by Tim Graham
parent f6671c5d78
commit 6dbe56ed78
2 changed files with 27 additions and 2 deletions

View File

@@ -107,6 +107,19 @@ class AggregationTests(TestCase):
for attr, value in six.iteritems(kwargs):
self.assertEqual(getattr(obj, attr), value)
def test_annotation_with_value(self):
values = Book.objects.filter(
name='Practical Django Projects',
).annotate(
discount_price=F('price') * 2,
).values(
'discount_price',
).annotate(sum_discount=Sum('discount_price'))
self.assertSequenceEqual(
values,
[{'discount_price': Decimal('59.38'), 'sum_discount': Decimal('59.38')}]
)
def test_aggregates_in_where_clause(self):
"""
Regression test for #12822: DatabaseError: aggregates not allowed in