From 0c8484652ef094f3234994830570a4b199eab647 Mon Sep 17 00:00:00 2001 From: Carlos Valverde Date: Tue, 8 Mar 2022 15:24:02 +0000 Subject: [PATCH] [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 --- addons/website/tests/test_fuzzy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/tests/test_fuzzy.py b/addons/website/tests/test_fuzzy.py index 2f4f89014b1..7bbfaf53275 100644 --- a/addons/website/tests/test_fuzzy.py +++ b/addons/website/tests/test_fuzzy.py @@ -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")