mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29209 -- Fixed Cast() with TextField on MySQL and Oracle.
This commit is contained in:
committed by
Tim Graham
parent
c12745f682
commit
d696fccae6
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user