1
0
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:
Sergey Fedoseev
2017-07-15 06:56:01 +05:00
committed by Tim Graham
parent 5debbdfcc8
commit 504ce3914f
8 changed files with 49 additions and 36 deletions

View File

@@ -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