mirror of
https://github.com/django/django.git
synced 2025-01-05 16:06:07 +00:00
Refs #28211 -- Added a test for ANDing empty Q()'s.
This test passes to due some logic in Node.add().
This commit is contained in:
parent
67e1afb4a8
commit
1c3a6cec2a
@ -3,6 +3,14 @@ from django.test import SimpleTestCase
|
|||||||
|
|
||||||
|
|
||||||
class QTests(SimpleTestCase):
|
class QTests(SimpleTestCase):
|
||||||
|
def test_combine_and_empty(self):
|
||||||
|
q = Q(x=1)
|
||||||
|
self.assertEqual(q & Q(), q)
|
||||||
|
self.assertEqual(Q() & q, q)
|
||||||
|
|
||||||
|
def test_combine_and_both_empty(self):
|
||||||
|
self.assertEqual(Q() & Q(), Q())
|
||||||
|
|
||||||
def test_deconstruct(self):
|
def test_deconstruct(self):
|
||||||
q = Q(price__gt=F('discounted_price'))
|
q = Q(price__gt=F('discounted_price'))
|
||||||
path, args, kwargs = q.deconstruct()
|
path, args, kwargs = q.deconstruct()
|
||||||
|
Loading…
Reference in New Issue
Block a user