Used homogeneous weights list in SearchRank tests.
A homogenous array is required on PostgreSQL.
@@ -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]
)
