Loading tests/queries/tests.py +11 −0 Original line number Diff line number Diff line Loading @@ -2852,3 +2852,14 @@ class DoubleInSubqueryTests(TestCase): qs = LeafB.objects.filter(pk__in=joins) self.assertQuerysetEqual( 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
tests/queries/tests.py +11 −0 Original line number Diff line number Diff line Loading @@ -2852,3 +2852,14 @@ class DoubleInSubqueryTests(TestCase): qs = LeafB.objects.filter(pk__in=joins) self.assertQuerysetEqual( 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'))