mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #28394 -- Allowed setting BaseExpression.output_field (renamed from _output_field).
This commit is contained in:
committed by
Tim Graham
parent
5debbdfcc8
commit
504ce3914f
@@ -532,6 +532,16 @@ class BasicExpressionsTests(TestCase):
|
||||
outer = Company.objects.filter(pk__in=Subquery(inner.values('pk')))
|
||||
self.assertFalse(outer.exists())
|
||||
|
||||
def test_explicit_output_field(self):
|
||||
class FuncA(Func):
|
||||
output_field = models.CharField()
|
||||
|
||||
class FuncB(Func):
|
||||
pass
|
||||
|
||||
expr = FuncB(FuncA())
|
||||
self.assertEqual(expr.output_field, FuncA.output_field)
|
||||
|
||||
|
||||
class IterableLookupInnerExpressionsTests(TestCase):
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user