[FIX] website_sale: fix tour on free delivery

The tour was using a payment provider that was not installed. This
commit makes sure the test only runs when the payment provider is
installed.

Fixes build error 19829

closes odoo/odoo#130214

X-original-commit: ba75b1c023988e17852821ddaf32163c2e2f9d6e
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
This commit is contained in:
Valentin Vallaeys (vava)
2023-08-01 13:51:44 +02:00
parent cdc8e4daad
commit feb15f6be6
@@ -7,6 +7,15 @@ import odoo.tests
class TestUi(odoo.tests.HttpCase):
def test_01_free_delivery_when_exceed_threshold(self):
if self.env['ir.module.module']._get('payment_custom').state != 'installed':
self.skipTest("Transfer provider is not installed")
transfer_provider = self.env.ref('payment.payment_provider_transfer')
transfer_provider.write({
'state': 'enabled',
'is_published': True,
})
transfer_provider._transfer_ensure_pending_msg_is_set()
# Avoid Shipping/Billing address page
self.env.ref('base.partner_admin').write({
@@ -62,10 +71,4 @@ class TestUi(odoo.tests.HttpCase):
'list_base_price': 0,
}])
self.env['account.journal'].create({'name': 'Cash - Test', 'type': 'cash', 'code': 'CASH - Test'})
# Ensure "Wire Transfer" is the default provider.
# Providers are sorted by state, showing `test` providers first (don't ask why).
self.env.ref("payment.payment_provider_transfer").write({"state": "test"})
self.start_tour("/", 'check_free_delivery', login="admin")