mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #29125 -- Made Q.deconstruct() deterministic with multiple keyword arguments.
This commit is contained in:
parent
a6fb81750a
commit
b95c49c954
3 changed files with 14 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue