diff --git a/tests/queries/test_q.py b/tests/queries/test_q.py index 9b9fba6ba13..7be2361f04e 100644 --- a/tests/queries/test_q.py +++ b/tests/queries/test_q.py @@ -3,6 +3,14 @@ from django.test import 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): q = Q(price__gt=F('discounted_price')) path, args, kwargs = q.deconstruct()