diff options
| author | Simon Charette <simon.charette@zapier.com> | 2019-05-12 17:17:47 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-15 10:58:29 +0200 |
| commit | 1e38f1191de21b6e96736f58df57dfb851a28c1f (patch) | |
| tree | 99b2c92d87d4d351d1f180e93a543b8903ec28d3 /tests/aggregation | |
| parent | d08e6f55e3a986a8d4b3a58431d9615c7bc81eaa (diff) | |
Fixed #30446 -- Resolved Value.output_field for stdlib types.
This required implementing a limited form of dynamic dispatch to combine
expressions with numerical output. Refs #26355 should eventually provide
a better interface for that.
Diffstat (limited to 'tests/aggregation')
| -rw-r--r-- | tests/aggregation/tests.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/aggregation/tests.py b/tests/aggregation/tests.py index a8377c9a26..da78b8d9a9 100644 --- a/tests/aggregation/tests.py +++ b/tests/aggregation/tests.py @@ -848,10 +848,6 @@ class AggregateTestCase(TestCase): book = Book.objects.annotate(val=Max(2, output_field=IntegerField())).first() self.assertEqual(book.val, 2) - def test_missing_output_field_raises_error(self): - with self.assertRaisesMessage(FieldError, 'Cannot resolve expression type, unknown output_field'): - Book.objects.annotate(val=Max(2)).first() - def test_annotation_expressions(self): authors = Author.objects.annotate(combined_ages=Sum(F('age') + F('friends__age'))).order_by('name') authors2 = Author.objects.annotate(combined_ages=Sum('age') + Sum('friends__age')).order_by('name') @@ -893,7 +889,7 @@ class AggregateTestCase(TestCase): def test_combine_different_types(self): msg = ( - 'Expression contains mixed types: FloatField, IntegerField. ' + 'Expression contains mixed types: FloatField, DecimalField. ' 'You must set output_field.' ) qs = Book.objects.annotate(sums=Sum('rating') + Sum('pages') + Sum('price')) |
