| 1 |
|
| 2 |
|
| 3 |
from odoo.tests import HttpCase, tagged |
| 4 |
from odoo.tools import mute_logger |
| 5 |
|
| 6 |
from odoo.addons.website_sale_collect.tests.common import ClickAndCollectCommon |
| 7 |
|
| 8 |
|
| 9 |
@tagged('post_install', '-at_install') |
| 10 |
class TestOnSitePaymentTransaction(HttpCase, ClickAndCollectCommon): |
| 11 |
|
| 12 |
def test_choosing_on_site_payment_confirms_order(self): |
| 13 |
order = self._create_so(carrier_id=self.carrier.id, state='draft') |
| 14 |
tx = self._create_transaction( |
| 15 |
flow='direct', |
| 16 |
sale_order_ids=[order.id], |
| 17 |
state='pending', |
| 18 |
payment_method_id=self.provider.payment_method_ids.id, |
| 19 |
) |
| 20 |
with mute_logger('odoo.addons.sale.models.payment_transaction'): |
| 21 |
tx._post_process() |
| 22 |
|
| 23 |
self.assertEqual(order.state, 'sale') |