mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #29142 -- Fixed crash when OuterRef is used with an operator.
This commit is contained in:
committed by
Tim Graham
parent
f5c6fc045a
commit
c412926a2e
@@ -575,6 +575,11 @@ class BasicExpressionsTests(TestCase):
|
||||
outer = Result.objects.filter(pk__in=Subquery(inner.values('pk')))
|
||||
self.assertFalse(outer.exists())
|
||||
|
||||
def test_outerref_with_operator(self):
|
||||
inner = Company.objects.filter(num_employees=OuterRef('ceo__salary') + 2)
|
||||
outer = Company.objects.filter(pk__in=Subquery(inner.values('pk')))
|
||||
self.assertEqual(outer.get().name, 'Test GmbH')
|
||||
|
||||
|
||||
class IterableLookupInnerExpressionsTests(TestCase):
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user