Skip to content

Commit c1a79fd

Browse files
sjai-odoovlst-odoo
authored andcommitted
[FIX] l10n_id_pos: fix tests
- used `TestPointOfSaleHttpCommon` in place of which it self contain `AccountTestInvoicingHttpCommon` and we will be able to use start_pos_tour method.
1 parent ff4c5b4 commit c1a79fd

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

addons/l10n_id_pos/tests/test_qris_pos.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
from odoo.exceptions import ValidationError
22
from odoo.tests import tagged
3-
from odoo.addons.account.tests.common import AccountTestInvoicingHttpCommon
3+
from odoo.addons.point_of_sale.tests.test_frontend import TestPointOfSaleHttpCommon
44
from unittest.mock import patch
55
from freezegun import freeze_time
66

77

88
@tagged('post_install_l10n', 'post_install', '-at_install')
9-
class TestPosQris(AccountTestInvoicingHttpCommon):
9+
class TestPosQris(TestPointOfSaleHttpCommon):
1010
""" Testing QRIS payment via PoS """
1111

1212
@classmethod
13-
@AccountTestInvoicingHttpCommon.setup_chart_template('id')
1413
def setUpClass(cls):
1514
super().setUpClass()
16-
cls.company_data['company'].qr_code = True
17-
cls.company_data['company'].partner_id.update({
15+
cls.company.update({
16+
'qr_code': True,
17+
'currency_id': cls.env.ref('base.IDR').id,
18+
})
19+
cls.company.partner_id.update({
1820
'country_id': cls.env.ref('base.id').id,
1921
'city': 'Jakarta',
2022
})
23+
cls.pos_user.write({
24+
"group_ids": [
25+
(4, cls.env.ref('account.group_account_invoice').id)
26+
]
27+
})
2128

2229
cls.acc_qris_id = cls.env['res.partner.bank'].create({
2330
'acc_number': '123456789012345678',
@@ -36,19 +43,6 @@ def setUpClass(cls):
3643
'taxes_id': False,
3744
})
3845

39-
# Create user.
40-
cls.pos_user = cls.env['res.users'].create({
41-
'name': 'A simple PoS man!',
42-
'login': 'pos_user',
43-
'password': 'pos_user',
44-
'group_ids': [
45-
(4, cls.env.ref('base.group_user').id),
46-
(4, cls.env.ref('point_of_sale.group_pos_user').id),
47-
(4, cls.env.ref('account.group_account_invoice').id),
48-
],
49-
})
50-
51-
cls.company = cls.company_data['company']
5246
cls.pos_receivable_bank = cls.copy_account(cls.company.account_default_pos_receivable_account_id, {'name': 'POS Receivable Bank'})
5347
cls.outstanding_bank = cls.copy_account(cls.outbound_payment_method_line.payment_account_id, {'name': 'Outstanding Bank'})
5448

0 commit comments

Comments
 (0)