summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-15 10:25:39 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-18 09:16:21 +0100
commitb6be0699b9e2f39c1cbd20e36c58d6c3dc70a1f0 (patch)
tree9771f9d596b2a279cc322bedaa4a81555551a120 /tests
parentfa6076daf460df2c2c5ff9f62862f050bc4427f4 (diff)
[3.0.x] Fixed #30986 -- Fixed queryset crash when filtering against boolean RawSQL expressions on Oracle.
Backport of 8685e764efd2957085762d9249e07794d9a58dcb from master
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index f50c634014..39dc2680fc 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -91,6 +91,14 @@ class BasicExpressionsTests(TestCase):
2,
)
+ def test_filtering_on_rawsql_that_is_boolean(self):
+ self.assertEqual(
+ Company.objects.filter(
+ RawSQL('num_employees > %s', (3,), output_field=models.BooleanField()),
+ ).count(),
+ 2,
+ )
+
def test_filter_inter_attribute(self):
# We can filter on attribute relationships on same model obj, e.g.
# find companies where the number of employees is greater