summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-06-01 00:26:16 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-06-01 00:28:44 +0300
commit84909377f2f2eea07ab8bf398dafc69e2d736b50 (patch)
tree13cb6f7a9cf95ada054bea715fafb19ec249bf27
parentfa7cb4ef3cc5f4c3514857bd25b43d31815eba94 (diff)
Fixed #18785 -- Added Test join trimming regression
The regression was caused by patch to ticket #15316 and was fixed by a patch to #10790.
-rw-r--r--tests/queries/tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/queries/tests.py b/tests/queries/tests.py
index d28291f340..8d1b19f169 100644
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -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'))