Add tests on the euristic to compute the full text search configuration

issue11130
review395301002
This commit is contained in:
Nicolas Évrard committed 2022-02-08 18:45:42 +01:00
1 parent 7e3007ede1
commit 2147a5de01
1 file changed
+7 -1
+7 -1
View File
@@ -243,8 +243,10 @@ class CommonTestCaseMixin:
def test_search_ilike(self):
"Test search text ilike"
Text = self.Text()
text, = Text.create([{
text, sambreville = Text.create([{
'text': "Bar",
}, {
'text': "Sambreville",
}])
with Transaction().set_context({
'%s.text.search_full_text' % Text.__name__: False,
@@ -267,6 +269,10 @@ class CommonTestCaseMixin:
self.assertListEqual(texts_foo, [])
self.assertListEqual(texts_f, [])
self.assertListEqual(
Text.search([('text', 'ilike', "%Sambreville%")]),
[sambreville])
@unittest.skipIf(backend.name == 'sqlite',
"SQLite does not have full text search")
@with_transaction()