Skip to content

Commit

Permalink
Fixed #33464 -- Resolved output_field for combined numeric expression…
Browse files Browse the repository at this point in the history
…s with MOD operator.
  • Loading branch information
David-Wobrock committed Sep 27, 2022
1 parent bf47c71 commit cff1f88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions django/db/models/expressions.py
Expand Up @@ -533,6 +533,7 @@ def __hash__(self):
Combinable.SUB,
Combinable.MUL,
Combinable.DIV,
Combinable.MOD,
)
},
# Bitwise operators.
Expand Down
8 changes: 7 additions & 1 deletion tests/expressions/tests.py
Expand Up @@ -2416,7 +2416,13 @@ def test_resolve_output_field_number(self):
(IntegerField, FloatField, FloatField),
(FloatField, IntegerField, FloatField),
]
connectors = [Combinable.ADD, Combinable.SUB, Combinable.MUL, Combinable.DIV]
connectors = [
Combinable.ADD,
Combinable.SUB,
Combinable.MUL,
Combinable.DIV,
Combinable.MOD,
]
for lhs, rhs, combined in tests:
for connector in connectors:
with self.subTest(
Expand Down

0 comments on commit cff1f88

Please sign in to comment.