--
Ticket URL: <https://code.djangoproject.com/ticket/24924>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "24924.diff" added.
Failing test case
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Attached a test case that fails because of this issue.
{{{
$ python runtests.py expressions_case
Creating test database for alias 'default'...
Creating test database for alias 'other'...
......................................F.....................s...............
======================================================================
FAIL: test_join_promotion_with_multiple_annotations
(expressions_case.tests.CaseExpressionTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rob/rob/caktus/django/tests/expressions_case/tests.py", line
1073, in test_join_promotion_with_multiple_annotations
lambda x: (x, x.foo, x.bar)
File "/home/rob/rob/caktus/django/django/test/testcases.py", line 932,
in assertQuerysetEqual
return self.assertEqual(list(items), values, msg=msg)
AssertionError: Lists differ: [] != [(<CaseTestModel: 1, 1>, 3, 5)]
Second list contains 1 additional elements.
First extra element 0:
(<CaseTestModel: 1, 1>, 3, 5)
- []
+ [(<CaseTestModel: 1, 1>, 3, 5)]
----------------------------------------------------------------------
Ran 76 tests in 0.172s
FAILED (failures=1, skipped=1)
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
}}}
The query returns an empty list because of the inner join.
--
Ticket URL: <https://code.djangoproject.com/ticket/24924#comment:1>
* has_patch: 0 => 1
Comment:
Added PR to fix https://github.com/django/django/pull/4810. Docs added
under the assumption that this bug would be backported to 1.8.X.
--
Ticket URL: <https://code.djangoproject.com/ticket/24924#comment:2>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"541f4ea546ad3065852db816769ba6b584e3f373" 541f4ea5]:
{{{
#!CommitTicketReference repository=""
revision="541f4ea546ad3065852db816769ba6b584e3f373"
Fixed #24924 -- Join promotion for multiple Case expressions
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24924#comment:3>
Comment (by Tim Graham <timograham@…>):
In [changeset:"0cfb7ed5c531d3fdb1c4eb79a004c2ea7e7a23e3" 0cfb7ed]:
{{{
#!CommitTicketReference repository=""
revision="0cfb7ed5c531d3fdb1c4eb79a004c2ea7e7a23e3"
[1.8.x] Fixed #24924 -- Join promotion for multiple Case expressions
Backport of 541f4ea546ad3065852db816769ba6b584e3f373 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/24924#comment:4>