mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #33257 -- Fixed Case() and ExpressionWrapper() with decimal values on SQLite.
This commit is contained in:
parent
4f8c7fd9d9
commit
1a5023883b
3 changed files with 18 additions and 2 deletions
|
@ -1178,6 +1178,13 @@ class ExpressionsNumericTests(TestCase):
|
|||
ordered=False
|
||||
)
|
||||
|
||||
def test_filter_decimal_expression(self):
|
||||
obj = Number.objects.create(integer=0, float=1, decimal_value=Decimal('1'))
|
||||
qs = Number.objects.annotate(
|
||||
x=ExpressionWrapper(Value(1), output_field=DecimalField()),
|
||||
).filter(Q(x=1, integer=0) & Q(x=Decimal('1')))
|
||||
self.assertSequenceEqual(qs, [obj])
|
||||
|
||||
def test_complex_expressions(self):
|
||||
"""
|
||||
Complex expressions of different connection types are possible.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue