[IMP] website: make fuzzy test more robust

New data will be introduced that involve the "product" word... while
this is a word a fuzzy test is based on. This commit adapts the test so
that its results are based on words that are less likely to appear in
default data.

task-2406626

Part-of: odoo/odoo#67913
Co-authored-by: Benoit Socias <bso@odoo.com>
This commit is contained in:
Carlos Valverde
2023-05-12 19:54:08 +02:00
committed by qsm-odoo
co-authored by Benoit Socias
parent 8b09cd722f
commit 0c8484652e
+2 -2
View File
@@ -225,7 +225,7 @@ class TestAutoComplete(TransactionCase):
def test_07_no_fuzzy_for_mostly_number(self):
""" Ensures exact match is used when search contains mostly numbers. """
self._create_page('Product P7935432254U7 page', 'Product P7935432254U7', '/numberpage')
self._create_page('Product P7935432254U7 page', 'Product P7935432254U7 kangaroo shoes', '/numberpage')
suggestions = self._autocomplete("54321")
self.assertEqual(0, suggestions['results_count'], "Test data contains no exact match")
suggestions = self._autocomplete("54322")
@@ -235,7 +235,7 @@ class TestAutoComplete(TransactionCase):
suggestions = self._autocomplete("P79354")
self.assertEqual(1, suggestions['results_count'], "Test data contains one exact match")
self.assertFalse(suggestions['fuzzy_search'], "Expects an exact match")
suggestions = self._autocomplete("produkt")
suggestions = self._autocomplete("kangroo") # must contain a typo
self.assertEqual(1, suggestions['results_count'], "Test data contains one fuzzy match")
self.assertTrue(suggestions['fuzzy_search'], "Expects a fuzzy match")