Skip to content

Commit

Permalink
Fixed #18785 -- Added Test join trimming regression
Browse files Browse the repository at this point in the history
The regression was caused by patch to ticket #15316 and was fixed by a
patch to #10790.
  • Loading branch information
akaariai committed May 31, 2013
1 parent fa7cb4e commit 8490937
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/queries/tests.py
Expand Up @@ -2852,3 +2852,14 @@ def test_double_subquery_in(self):
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'))

0 comments on commit 8490937

Please sign in to comment.