[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#57777

X-original-commit: 19319a7f88f474a6410ea1dabc6bcc1ac51e97bb
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Jeremy Kersten
2020-09-15 16:49:40 +00:00
parent 869a37f5f9
commit c2c2fed0a2
+3 -1
View File
@@ -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)