From d8c876190132b03faa11e37b2d9abd6fb2ff48fd Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Tue, 6 Dec 2022 12:45:47 +0100 Subject: [PATCH] Used homogeneous weights list in SearchRank tests. A homogenous array is required on PostgreSQL. --- tests/postgres_tests/test_search.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/postgres_tests/test_search.py b/tests/postgres_tests/test_search.py index d595437a62..6ec20c0654 100644 --- a/tests/postgres_tests/test_search.py +++ b/tests/postgres_tests/test_search.py @@ -514,10 +514,11 @@ class TestRankingAndWeights(GrailTestData, PostgreSQLTestCase): vector = SearchVector("dialogue", weight="D") + SearchVector( "character__name", weight="A" ) + weights = [1.0, 0.0, 0.0, 0.5] searched = ( Line.objects.filter(scene=self.witch_scene) .annotate( - rank=SearchRank(vector, SearchQuery("witch"), weights=[1, 0, 0, 0.5]), + rank=SearchRank(vector, SearchQuery("witch"), weights=weights), ) .order_by("-rank")[:2] )