mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Refs #25367 -- Made Query.build_filter() raise TypeError on non-conditional expressions.
This commit is contained in:
parent
e9a0e1d4f6
commit
f97a6123c0
2 changed files with 9 additions and 1 deletions
|
@ -144,3 +144,9 @@ class TestQuery(SimpleTestCase):
|
|||
msg = 'Joined field references are not permitted in this query'
|
||||
with self.assertRaisesMessage(FieldError, msg):
|
||||
query.build_where(filter_expr)
|
||||
|
||||
def test_filter_non_conditional(self):
|
||||
query = Query(Item)
|
||||
msg = 'Cannot filter against a non-conditional expression.'
|
||||
with self.assertRaisesMessage(TypeError, msg):
|
||||
query.build_where(Func(output_field=CharField()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue