summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/db/models/expressions.py1
-rw-r--r--tests/expressions/tests.py6
2 files changed, 5 insertions, 2 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py
index a9768919a2..90d90119d0 100644
--- a/django/db/models/expressions.py
+++ b/django/db/models/expressions.py
@@ -421,6 +421,7 @@ class Expression(BaseExpression, Combinable):
_connector_combinators = {
connector: [
+ (fields.IntegerField, fields.IntegerField, fields.IntegerField),
(fields.IntegerField, fields.DecimalField, fields.DecimalField),
(fields.DecimalField, fields.IntegerField, fields.DecimalField),
(fields.IntegerField, fields.FloatField, fields.FloatField),
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index 42b6b828f4..0ae61a6506 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -9,8 +9,8 @@ from unittest import mock
from django.core.exceptions import FieldError
from django.db import DatabaseError, NotSupportedError, connection
from django.db.models import (
- Avg, BinaryField, BooleanField, Case, CharField, Count, DateField,
- DateTimeField, DecimalField, DurationField, Exists, Expression,
+ AutoField, Avg, BinaryField, BooleanField, Case, CharField, Count,
+ DateField, DateTimeField, DecimalField, DurationField, Exists, Expression,
ExpressionList, ExpressionWrapper, F, FloatField, Func, IntegerField, Max,
Min, Model, OrderBy, OuterRef, Q, StdDev, Subquery, Sum, TimeField,
UUIDField, Value, Variance, When,
@@ -1893,6 +1893,8 @@ class CombinableTests(SimpleTestCase):
class CombinedExpressionTests(SimpleTestCase):
def test_resolve_output_field(self):
tests = [
+ (IntegerField, AutoField, IntegerField),
+ (AutoField, IntegerField, IntegerField),
(IntegerField, DecimalField, DecimalField),
(DecimalField, IntegerField, DecimalField),
(IntegerField, FloatField, FloatField),