mirror of https://github.com/django/django.git
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: [
|
||||
(fields.IntegerField, fields.IntegerField, fields.IntegerField),
|
||||
(fields.IntegerField, fields.DecimalField, fields.DecimalField),
|
||||
(fields.DecimalField, fields.IntegerField, fields.DecimalField),
|
||||
(fields.IntegerField, fields.FloatField, fields.FloatField),
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue