From ace7f03bab4bdb5c56e027b810141d20e5b08430 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 17 Oct 2019 15:42:29 +0000 Subject: [PATCH] [FIX] website: make test works with more website than the data ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test was raising an assert error if the DB has other websites than the data/demo ones. As we have a new module in Odoo 13.0 (https://github.com/odoo/design-themes/pull/178) which is creating 25 websites, and since the design-themes runbot is now running tests, we were having a red design-themes runbot. closes odoo/odoo#39008 X-original-commit: 5c7b446363fbec7b2a76a579794e0fac20d05271 Signed-off-by: Jérémy Kersten (jke) --- addons/website/tests/test_get_current_website.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/tests/test_get_current_website.py b/addons/website/tests/test_get_current_website.py index 57d85887b4d..ee02a4d5ff8 100644 --- a/addons/website/tests/test_get_current_website.py +++ b/addons/website/tests/test_get_current_website.py @@ -50,7 +50,7 @@ class TestGetCurrentWebsite(TransactionCase): self.assertEqual(Website._get_current_website_id('', country3.id), website2.id) # CASE: no domain, wrong country: get first - self.assertEqual(Website._get_current_website_id('', country4.id), website1.id) + self.assertEqual(Website._get_current_website_id('', country4.id), Website.search([]).sorted('country_group_ids')[0].id) # CASE: no domain, multiple country: get first self.assertEqual(Website._get_current_website_id('', country5.id), website1.id)