test_payment_provider.py 726 B

123456789101112131415161718
  1. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  2. from odoo.tests import tagged
  3. from odoo.addons.payment_mercado_pago.tests.common import MercadoPagoCommon
  4. @tagged('post_install', '-at_install')
  5. class TestPaymentProvider(MercadoPagoCommon):
  6. def test_incompatible_with_unsupported_currencies(self):
  7. """ Test that Mercado Pago providers are filtered out from compatible providers when the
  8. currency is not supported. """
  9. compatible_providers = self.env['payment.provider']._get_compatible_providers(
  10. self.company_id, self.partner.id, self.amount, currency_id=self.env.ref('base.AFN').id
  11. )
  12. self.assertNotIn(self.provider, compatible_providers)