mirror of https://github.com/django/django.git
Used homogeneous weights list in SearchRank tests.
A homogenous array is required on PostgreSQL.
This commit is contained in:
parent
c14e5c64c9
commit
d8c8761901
|
@ -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]
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue