summaryrefslogtreecommitdiff
path: root/tests/db_functions/text/test_pad.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2020-06-16 10:01:34 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-06-16 10:08:02 +0200
commitea3beb4f5a61870c87ba028369de4d2c2f316ad0 (patch)
tree6e3315aa9757a503698860d0f277254f26621c7c /tests/db_functions/text/test_pad.py
parent0d6d4e78b17d7500e1a503fd2b02fdcf822d9d3c (diff)
downloaddjango-ea3beb4f5a61870c87ba028369de4d2c2f316ad0.tar.gz
Refs #30446 -- Defined default output_field of text database functions.
This prevented the default behavior of BaseExpression._resolve_output_field from error'ing out when such functions accepted both expressions from mixed types (e.g. SubStr(CharField, IntegerField, IntegerField)).
Diffstat (limited to 'tests/db_functions/text/test_pad.py')
-rw-r--r--tests/db_functions/text/test_pad.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/db_functions/text/test_pad.py b/tests/db_functions/text/test_pad.py
index 88309e5641..17c33a30d8 100644
--- a/tests/db_functions/text/test_pad.py
+++ b/tests/db_functions/text/test_pad.py
@@ -1,5 +1,5 @@
from django.db import connection
-from django.db.models import CharField, Value
+from django.db.models import Value
from django.db.models.functions import Length, LPad, RPad
from django.test import TestCase
@@ -42,7 +42,7 @@ class PadTests(TestCase):
def test_combined_with_length(self):
Author.objects.create(name='Rhonda', alias='john_smith')
Author.objects.create(name='♥♣♠', alias='bytes')
- authors = Author.objects.annotate(filled=LPad('name', Length('alias'), output_field=CharField()))
+ authors = Author.objects.annotate(filled=LPad('name', Length('alias')))
self.assertQuerysetEqual(
authors.order_by('alias'),
[' ♥♣♠', ' Rhonda'],