summaryrefslogtreecommitdiff
path: root/tests/expressions/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/expressions/tests.py')
-rw-r--r--tests/expressions/tests.py7
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.