summaryrefslogtreecommitdiff
path: root/tests/aggregation
diff options
context:
space:
mode:
authorLoic Bistuer <loic.bistuer@gmail.com>2015-01-21 12:47:49 +0700
committerLoic Bistuer <loic.bistuer@gmail.com>2015-01-22 00:44:14 +0700
commitd450af8a2687ca2e90a8790eb567f9a25ebce85b (patch)
treead670295a2af7f005ce5e591a573adaebd76d3aa /tests/aggregation
parent039465a6a7a18f48ea77ceadb6949990c0ec92e1 (diff)
Fixed small inconsistency when handling aggregate's default_alias.
Refs #14030.
Diffstat (limited to 'tests/aggregation')
-rw-r--r--tests/aggregation/tests.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py
index ec19fcfd53..7e500dfb0e 100644
--- a/tests/aggregation/tests.py
+++ b/tests/aggregation/tests.py
@@ -768,10 +768,12 @@ class ComplexAggregateTestCase(TestCase):
self.assertEqual(b3.sums, Approximate(Decimal("383.69"), places=2))
def test_complex_aggregations_require_kwarg(self):
- with six.assertRaisesRegex(self, TypeError, 'Complex expressions require an alias'):
+ with six.assertRaisesRegex(self, TypeError, 'Complex annotations require an alias'):
Author.objects.annotate(Sum(F('age') + F('friends__age')))
with six.assertRaisesRegex(self, TypeError, 'Complex aggregates require an alias'):
Author.objects.aggregate(Sum('age') / Count('age'))
+ with six.assertRaisesRegex(self, TypeError, 'Complex aggregates require an alias'):
+ Author.objects.aggregate(Sum(Value(1)))
def test_aggregate_over_complex_annotation(self):
qs = Author.objects.annotate(