diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-11-15 10:25:39 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-11-18 08:50:09 +0100 |
| commit | 8685e764efd2957085762d9249e07794d9a58dcb (patch) | |
| tree | 4a86216811328fb8a2a2d275fbb4cc524f94d272 /tests | |
| parent | 22a7a406c99f5340e05860fee95df9629cb516a9 (diff) | |
Fixed #30986 -- Fixed queryset crash when filtering against boolean RawSQL expressions on Oracle.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/expressions/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index 1dba3d083a..ee8b246966 100644 --- a/tests/expressions/tests.py +++ b/tests/expressions/tests.py @@ -92,6 +92,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 |
