diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-05-10 17:22:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-10 17:22:45 +0200 |
commit | 6e32d1fa1dafd0c9cd9f93997ecebb26cd9a1b62 (patch) | |
tree | 7646d821bc72b65acbc620906fa98569f4901e37 /tests | |
parent | c494c6974dd0e7c5a43ea3e220b34641abc3ba29 (diff) | |
download | django-6e32d1fa1dafd0c9cd9f93997ecebb26cd9a1b62.tar.gz |
Fixed #34554 -- Fixed Reverse(Value(…)) crash on Oracle.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/db_functions/text/test_reverse.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/db_functions/text/test_reverse.py b/tests/db_functions/text/test_reverse.py index 62d769d80c..3e94c111be 100644 --- a/tests/db_functions/text/test_reverse.py +++ b/tests/db_functions/text/test_reverse.py @@ -1,5 +1,5 @@ from django.db import connection -from django.db.models import CharField +from django.db.models import CharField, Value from django.db.models.functions import Length, Reverse, Trim from django.test import TestCase from django.test.utils import register_lookup @@ -24,15 +24,18 @@ class ReverseTests(TestCase): ) def test_basic(self): - authors = Author.objects.annotate(backward=Reverse("name")) + authors = Author.objects.annotate( + backward=Reverse("name"), + constant=Reverse(Value("static string")), + ) self.assertQuerySetEqual( authors, [ - ("John Smith", "htimS nhoJ"), - ("Élena Jordan", "nadroJ anelÉ"), - ("パイソン", "ンソイパ"), + ("John Smith", "htimS nhoJ", "gnirts citats"), + ("Élena Jordan", "nadroJ anelÉ", "gnirts citats"), + ("パイソン", "ンソイパ", "gnirts citats"), ], - lambda a: (a.name, a.backward), + lambda a: (a.name, a.backward, a.constant), ordered=False, ) |