summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2017-10-25 21:52:38 +0200
committerGitHub <noreply@github.com>2017-10-25 21:52:38 +0200
commit81e357a7e19f35235cc998459a10213532727d4e (patch)
treebfe23a951cdeae317998052a9b685866c3b1c687 /tests
parent171c7cc863eafc2346aa84ffd1d540644539f1a4 (diff)
Fixed #28689 -- Fixed unquoted table names in Subquery SQL when using OuterRef.
Regression in f48bc7c3dbd204eefb3c19016b1e4906ac26bee3.
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions/models.py1
-rw-r--r--tests/expressions/tests.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/expressions/models.py b/tests/expressions/models.py
index 85f18fdf0e..34fd9dff16 100644
--- a/tests/expressions/models.py
+++ b/tests/expressions/models.py
@@ -50,6 +50,7 @@ class Experiment(models.Model):
end = models.DateTimeField()
class Meta:
+ db_table = 'expressions_ExPeRiMeNt'
ordering = ('name',)
def duration(self):
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index f941c5521e..57613d3421 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -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