1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[2.0.x] Fixed #28689 -- Fixed unquoted table names in Subquery SQL when using OuterRef.

Regression in f48bc7c3db.

Backport of 81e357a7e1 from master
This commit is contained in:
Mariusz Felisiak
2017-10-25 21:52:38 +02:00
committed by Tim Graham
parent 01987bc0b4
commit f5184ae5dc
4 changed files with 10 additions and 1 deletions

View File

@@ -545,6 +545,11 @@ class BasicExpressionsTests(TestCase):
expr = FuncB(FuncA())
self.assertEqual(expr.output_field, FuncA.output_field)
def test_outerref_mixed_case_table_name(self):
inner = Result.objects.filter(result_time__gte=OuterRef('experiment__assigned'))
outer = Result.objects.filter(pk__in=Subquery(inner.values('pk')))
self.assertFalse(outer.exists())
class IterableLookupInnerExpressionsTests(TestCase):
@classmethod