summaryrefslogtreecommitdiff
path: root/addons/website/tests/test_controllers.py
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2020-09-15 14:51:59 +0000
committerJeremy Kersten <jke@odoo.com>2020-09-15 16:25:51 +0000
commitb608aa30ba8866f60c28b28d32af1e35805aeed1 (patch)
tree9ea068d8d360920e5e1dc8818a876fc76cd52461 /addons/website/tests/test_controllers.py
parentaad941f6c4c7b6db5b9cf3860b411dbfecc9ea52 (diff)
[FIX] website: make test determinist for single install
When running -i website --test-enable, the test was falsy. The last page created page was present in matching_page wich one is a criteria to be excluded from last modified page to avoid duplicate suggested page. Now we substract correctly them before comparison. https://github.com/odoo/odoo/blob/saas-13.4/addons/website/controllers/main.py#L243 closes odoo/odoo#57773 X-original-commit: 19319a7f88f474a6410ea1dabc6bcc1ac51e97bb Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com> Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Diffstat (limited to 'addons/website/tests/test_controllers.py')
-rw-r--r--addons/website/tests/test_controllers.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/website/tests/test_controllers.py b/addons/website/tests/test_controllers.py
index edfb65feeb0..9bb167fedd5 100644
--- a/addons/website/tests/test_controllers.py
+++ b/addons/website/tests/test_controllers.py
@@ -41,4 +41,6 @@ class TestControllers(tests.HttpCase):
suggested_links = resp['result']
last_modified_history = next(o for o in suggested_links['others'] if o["title"] == "Last modified pages")
last_modified_values = map(lambda o: o['value'], last_modified_history['values'])
- self.assertTrue(set(last_modified_values) == set(last_5_url_edited))
+
+ matching_pages = set(map(lambda o: o['value'], suggested_links['matching_pages']))
+ self.assertEqual(set(last_modified_values), set(last_5_url_edited) - matching_pages)