diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2021-11-04 18:24:19 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-11-08 18:02:56 +0100 |
commit | 1a5023883bf4c8cccb34a830edcc3c82aa862455 (patch) | |
tree | ab3d3cdf1dd163ad365af1d611b142ab7948b6d9 /tests/expressions | |
parent | 4f8c7fd9d91b35e2c2922de4bb50c8c8066cbbc6 (diff) | |
download | django-1a5023883bf4c8cccb34a830edcc3c82aa862455.tar.gz |
Fixed #33257 -- Fixed Case() and ExpressionWrapper() with decimal values on SQLite.
Diffstat (limited to 'tests/expressions')
-rw-r--r-- | tests/expressions/tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index 4bb65c9031..dab5474ef4 100644 --- a/tests/expressions/tests.py +++ b/tests/expressions/tests.py @@ -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. |