mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #29125 -- Made Q.deconstruct() deterministic with multiple keyword arguments.
This commit is contained in:
@@ -60,6 +60,15 @@ class QTests(SimpleTestCase):
|
||||
))
|
||||
self.assertEqual(kwargs, {'_connector': 'AND'})
|
||||
|
||||
def test_deconstruct_multiple_kwargs(self):
|
||||
q = Q(price__gt=F('discounted_price'), price=F('discounted_price'))
|
||||
path, args, kwargs = q.deconstruct()
|
||||
self.assertEqual(args, (
|
||||
('price', F('discounted_price')),
|
||||
('price__gt', F('discounted_price')),
|
||||
))
|
||||
self.assertEqual(kwargs, {'_connector': 'AND'})
|
||||
|
||||
def test_deconstruct_nested(self):
|
||||
q = Q(Q(price__gt=F('discounted_price')))
|
||||
path, args, kwargs = q.deconstruct()
|
||||
|
||||
Reference in New Issue
Block a user