Fixed #18785 -- Added Test join trimming regression
The regression was caused by patch to ticket #15316 and was fixed by a patch to #10790.
This commit is contained in:
parent
fa7cb4ef3c
commit
84909377f2
|
@ -2852,3 +2852,14 @@ class DoubleInSubqueryTests(TestCase):
|
||||||
qs = LeafB.objects.filter(pk__in=joins)
|
qs = LeafB.objects.filter(pk__in=joins)
|
||||||
self.assertQuerysetEqual(
|
self.assertQuerysetEqual(
|
||||||
qs, [lfb1], lambda x: x)
|
qs, [lfb1], lambda x: x)
|
||||||
|
|
||||||
|
class Ticket18785Tests(unittest.TestCase):
|
||||||
|
def test_ticket_18785(self):
|
||||||
|
# Test join trimming from ticket18785
|
||||||
|
qs = Item.objects.exclude(
|
||||||
|
note__isnull=False
|
||||||
|
).filter(
|
||||||
|
name='something', creator__extra__isnull=True
|
||||||
|
).order_by()
|
||||||
|
self.assertEquals(1, str(qs.query).count('INNER JOIN'))
|
||||||
|
self.assertEquals(0, str(qs.query).count('OUTER JOIN'))
|
||||||
|
|
Loading…
Reference in New Issue