diff --git a/wagtail/contrib/postgres_search/tests/test_backend.py b/wagtail/contrib/postgres_search/tests/test_backend.py index 8f9494311b..01080214f9 100644 --- a/wagtail/contrib/postgres_search/tests/test_backend.py +++ b/wagtail/contrib/postgres_search/tests/test_backend.py @@ -107,6 +107,11 @@ class TestPostgresSearchBackend(BackendTests, TestCase): models.Book) self.assertUnsortedListEqual([r.title for r in results], []) + # Backslashes should be escaped inside each tsquery term. + results = self.backend.autocomplete("backslash\\", + models.Book) + self.assertUnsortedListEqual([r.title for r in results], []) + # Now suffixes. results = self.backend.autocomplete("Something:B", models.Book) self.assertUnsortedListEqual([r.title for r in results], [])