summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2017-10-25 21:52:38 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2017-10-25 22:00:19 +0200
commit11f6d435667dd28db0e861db55e51f53c28862d2 (patch)
treeb8ecd6393fb301af1a3e5d1e89eafc0a4bc569df /tests
parente98ae4fe6bc1baa402b10bc379d2e96b79bbb3b0 (diff)
downloaddjango-11f6d435667dd28db0e861db55e51f53c28862d2.tar.gz
[1.11.x] Fixed #28689 -- Fixed unquoted table names in Subquery SQL when using OuterRef.
Regression in f48bc7c3dbd204eefb3c19016b1e4906ac26bee3. Backport of 81e357a7e19f35235cc998459a10213532727d4e from master
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 b1a737d0b9..678af731f8 100644
--- a/tests/expressions/models.py
+++ b/tests/expressions/models.py
@@ -56,6 +56,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 253a9c0429..17d4ec4e7b 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -533,6 +533,11 @@ class BasicExpressionsTests(TestCase):
outer = Company.objects.filter(pk__in=Subquery(inner.values('pk')))
self.assertFalse(outer.exists())
+ 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