From 5d95a1c35ef1375a7badcb217c36c5974d1e57ee Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Thu, 11 Apr 2024 18:07:08 -0400 Subject: [PATCH] [5.0.x] Refs #35194 -- Adjusted a generated field test to work on Postgres 15.6+. Postgres >= 12.18, 13.14, 14.11, 15.6, 16.2 changed the way the immutability of generated and default expressions is detected in postgres/postgres@743ddaf. The adjusted test semantic is presereved by switching from __icontains to __contains as both make use of a `%` literal which requires proper escaping. Refs #35336. Thanks bcail for the report. Backport of 73b62a21265c4a417004d64d13a896469e2558f3 from main. --- tests/schema/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/schema/tests.py b/tests/schema/tests.py index 9c76a44200..663e0ec5f2 100644 --- a/tests/schema/tests.py +++ b/tests/schema/tests.py @@ -919,7 +919,7 @@ class SchemaTests(TransactionTestCase): editor.create_model(GeneratedFieldContainsModel) field = GeneratedField( - expression=Q(text__icontains="FOO"), + expression=Q(text__contains="foo"), db_persist=True, output_field=BooleanField(), )