mirror of
https://github.com/django/django.git
synced 2025-07-28 15:44:20 +00:00
Fixed #34459 -- Fixed SearchVector() crash for parameters with % symbol.
Thanks Patryk Zawadzki for the report.
Regression in 09ffc5c121
.
This commit is contained in:
parent
02a04ab79a
commit
4bf4222010
3 changed files with 11 additions and 4 deletions
|
@ -160,6 +160,12 @@ class SearchVectorFieldTest(GrailTestData, PostgreSQLTestCase):
|
|||
)
|
||||
self.assertNotIn("COALESCE(COALESCE", str(searched.query))
|
||||
|
||||
def test_values_with_percent(self):
|
||||
searched = Line.objects.annotate(
|
||||
search=SearchVector(Value("This week everything is 10% off"))
|
||||
).filter(search="10 % off")
|
||||
self.assertEqual(len(searched), 9)
|
||||
|
||||
|
||||
class SearchConfigTests(PostgreSQLSimpleTestCase):
|
||||
def test_from_parameter(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue