Fixed #31919 -- Resolved output_field of IntegerField subclasses combinations.
This commit is contained in:
parent
40894f2967
commit
38fce49c82
|
@ -421,6 +421,7 @@ class Expression(BaseExpression, Combinable):
|
||||||
|
|
||||||
_connector_combinators = {
|
_connector_combinators = {
|
||||||
connector: [
|
connector: [
|
||||||
|
(fields.IntegerField, fields.IntegerField, fields.IntegerField),
|
||||||
(fields.IntegerField, fields.DecimalField, fields.DecimalField),
|
(fields.IntegerField, fields.DecimalField, fields.DecimalField),
|
||||||
(fields.DecimalField, fields.IntegerField, fields.DecimalField),
|
(fields.DecimalField, fields.IntegerField, fields.DecimalField),
|
||||||
(fields.IntegerField, fields.FloatField, fields.FloatField),
|
(fields.IntegerField, fields.FloatField, fields.FloatField),
|
||||||
|
|
|
@ -9,8 +9,8 @@ from unittest import mock
|
||||||
from django.core.exceptions import FieldError
|
from django.core.exceptions import FieldError
|
||||||
from django.db import DatabaseError, NotSupportedError, connection
|
from django.db import DatabaseError, NotSupportedError, connection
|
||||||
from django.db.models import (
|
from django.db.models import (
|
||||||
Avg, BinaryField, BooleanField, Case, CharField, Count, DateField,
|
AutoField, Avg, BinaryField, BooleanField, Case, CharField, Count,
|
||||||
DateTimeField, DecimalField, DurationField, Exists, Expression,
|
DateField, DateTimeField, DecimalField, DurationField, Exists, Expression,
|
||||||
ExpressionList, ExpressionWrapper, F, FloatField, Func, IntegerField, Max,
|
ExpressionList, ExpressionWrapper, F, FloatField, Func, IntegerField, Max,
|
||||||
Min, Model, OrderBy, OuterRef, Q, StdDev, Subquery, Sum, TimeField,
|
Min, Model, OrderBy, OuterRef, Q, StdDev, Subquery, Sum, TimeField,
|
||||||
UUIDField, Value, Variance, When,
|
UUIDField, Value, Variance, When,
|
||||||
|
@ -1893,6 +1893,8 @@ class CombinableTests(SimpleTestCase):
|
||||||
class CombinedExpressionTests(SimpleTestCase):
|
class CombinedExpressionTests(SimpleTestCase):
|
||||||
def test_resolve_output_field(self):
|
def test_resolve_output_field(self):
|
||||||
tests = [
|
tests = [
|
||||||
|
(IntegerField, AutoField, IntegerField),
|
||||||
|
(AutoField, IntegerField, IntegerField),
|
||||||
(IntegerField, DecimalField, DecimalField),
|
(IntegerField, DecimalField, DecimalField),
|
||||||
(DecimalField, IntegerField, DecimalField),
|
(DecimalField, IntegerField, DecimalField),
|
||||||
(IntegerField, FloatField, FloatField),
|
(IntegerField, FloatField, FloatField),
|
||||||
|
|
Loading…
Reference in New Issue