summaryrefslogtreecommitdiff
path: root/tests/db_functions/test_cast.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/db_functions/test_cast.py')
-rw-r--r--tests/db_functions/test_cast.py3
1 files changed, 3 insertions, 0 deletions
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')