diff options
| author | Tim Graham <timograham@gmail.com> | 2018-02-12 14:00:29 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-02-12 14:52:32 -0500 |
| commit | b95c49c954e3b75678bb258e9fb2ec30d0d960bb (patch) | |
| tree | 31ec388f6e51d3c39aee0836251017170307edec /tests | |
| parent | a6fb81750a2f2c426e44f828b0e06420e760bf6d (diff) | |
Fixed #29125 -- Made Q.deconstruct() deterministic with multiple keyword arguments.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/queries/test_q.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/queries/test_q.py b/tests/queries/test_q.py index a90d6794db..2ed4278b77 100644 --- a/tests/queries/test_q.py +++ b/tests/queries/test_q.py @@ -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() |
