From d696fccae6ea0868855aa28f8d2bc2f7f77ac208 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Tue, 13 Mar 2018 06:57:14 +0500 Subject: Fixed #29209 -- Fixed Cast() with TextField on MySQL and Oracle. --- tests/db_functions/test_cast.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/db_functions/test_cast.py b/tests/db_functions/test_cast.py index 12932d95be..d66bec302f 100644 --- a/tests/db_functions/test_cast.py +++ b/tests/db_functions/test_cast.py @@ -74,3 +74,6 @@ class CastTests(TestCase): """ list(Author.objects.annotate(cast_float=Cast(Avg('age'), models.FloatField()))) self.assertIn('(AVG("db_functions_author"."age"))::double precision', connection.queries[-1]['sql']) + + def test_cast_to_text_field(self): + self.assertEqual(Author.objects.values_list(Cast('age', models.TextField()), flat=True).get(), '1') -- cgit v1.3