mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #16211 -- Added logical NOT support to F expressions.
This commit is contained in:
committed by
Mariusz Felisiak
parent
c01e76c95c
commit
a320aab512
@@ -8,7 +8,7 @@ from django.db.models import (
|
||||
Q,
|
||||
Value,
|
||||
)
|
||||
from django.db.models.expressions import RawSQL
|
||||
from django.db.models.expressions import NegatedExpression, RawSQL
|
||||
from django.db.models.functions import Lower
|
||||
from django.db.models.sql.where import NothingNode
|
||||
from django.test import SimpleTestCase, TestCase
|
||||
@@ -87,7 +87,7 @@ class QTests(SimpleTestCase):
|
||||
]
|
||||
for q in tests:
|
||||
with self.subTest(q=q):
|
||||
self.assertIs(q.negated, True)
|
||||
self.assertIsInstance(q, NegatedExpression)
|
||||
|
||||
def test_deconstruct(self):
|
||||
q = Q(price__gt=F("discounted_price"))
|
||||
|
||||
Reference in New Issue
Block a user