Skip to content

Commit 0246d70

Browse files
committed
[REF] pos*: use tour helper
1 parent 3cc25e8 commit 0246d70

File tree

13 files changed

+105
-116
lines changed

13 files changed

+105
-116
lines changed

addons/l10n_ar_pos/tests/test_pos_ar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ def test_basic_flow_ar(self):
5252
self.product_a.available_in_pos = True
5353
self.product_a.name = "A test product"
5454
self.main_pos_config.open_ui()
55-
self.start_tour(f"/pos/ui/{self.main_pos_config.id}", 'PosARBaseFlow', login="pos_user")
55+
self.start_pos_tour('PosARBaseFlow')

addons/l10n_be_pos_sale/tests/test_l10n_be_pos_sale.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ def test_settle_order_can_invoice(self):
120120
})],
121121
})
122122
self.main_pos_config.open_ui()
123-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PosSettleOrderTryInvoice', login="accountman")
123+
self.start_pos_tour('PosSettleOrderTryInvoice', login="accountman")

addons/l10n_es_pos/tests/test_frontend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_l10n_es_pos_reconcile(self):
9191
current_session.action_pos_session_closing_control()
9292

9393
self.main_pos_config.with_user(self.pos_admin).open_ui()
94-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'l10n_es_pos_settle_account_due', login="accountman")
94+
self.start_pos_tour('l10n_es_pos_settle_account_due', login="accountman")
9595

9696
def test_spanish_pos_invoice_no_certificate(self):
9797
"""This test make sure that the invoice generated in spanish PoS are not proforma invoices when no certificate exists"""

addons/l10n_id_pos/tests/test_qris_pos.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _patched_make_qris_request(endpoint, params):
156156

157157
self.main_pos_config.with_user(self.pos_user).open_ui()
158158
with patch('odoo.addons.l10n_id.models.res_bank._l10n_id_make_qris_request', side_effect=_patched_make_qris_request):
159-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenQRISPaymentFail', login="pos_user")
159+
self.start_pos_tour('PaymentScreenQRISPaymentFail')
160160

161161
def test_tour_qris_payment_success(self):
162162
""" Successful fetching status should proceed next to go to receipt screen"""
@@ -183,7 +183,7 @@ def _patched_make_qris_request(endpoint, params):
183183
}
184184
self.main_pos_config.with_user(self.pos_user).open_ui()
185185
with patch('odoo.addons.l10n_id.models.res_bank._l10n_id_make_qris_request', side_effect=_patched_make_qris_request):
186-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenQRISPaymentSuccess', login="pos_user")
186+
self.start_pos_tour('PaymentScreenQRISPaymentSuccess')
187187

188188
@freeze_time("2024-02-27 04:15:00")
189189
def test_only_call_api_call_once(self):
@@ -212,7 +212,7 @@ def _patched_make_qris_request(endpoint, params):
212212
}
213213
self.main_pos_config.with_user(self.pos_user).open_ui()
214214
with patch('odoo.addons.l10n_id.models.res_bank._l10n_id_make_qris_request', side_effect=_patched_make_qris_request) as patched:
215-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PayementScreenQRISFetchQR', login="pos_user")
215+
self.start_pos_tour('PayementScreenQRISFetchQR')
216216
self.assertEqual(patched.call_count, 1)
217217

218218
@freeze_time("2024-02-27 04:15:00")
@@ -233,5 +233,5 @@ def _patched_make_qris_request(endpoint, params):
233233
self.main_pos_config.with_user(self.pos_user).open_ui()
234234
self.main_pos_config.current_session_id.set_opening_control(0, 'notes')
235235
with patch('odoo.addons.l10n_id.models.res_bank._l10n_id_make_qris_request', side_effect=_patched_make_qris_request) as patched:
236-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PayementScreenQRISChangeAmount', login="pos_user")
236+
self.start_pos_tour('PayementScreenQRISChangeAmount')
237237
self.assertEqual(patched.call_count, 2)

addons/l10n_test_pos_qr_payment/tests/test_pos_qr_payment.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_01_pos_order_with_sepa_qr_payment_fail(self):
4343
})
4444
self.main_pos_config.with_user(self.pos_user).open_ui()
4545

46-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPaymentFailure', login="pos_user")
46+
self.start_pos_tour('PaymentScreenWithQRPaymentFailure')
4747

4848
def test_02_pos_order_with_sepa_qr_payment(self):
4949
""" Test Point of Sale QR Payment flow with SEPA
@@ -55,7 +55,7 @@ def test_02_pos_order_with_sepa_qr_payment(self):
5555
})
5656
self.main_pos_config.with_user(self.pos_user).open_ui()
5757

58-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPayment', login="pos_user")
58+
self.start_pos_tour('PaymentScreenWithQRPayment')
5959

6060

6161
@tagged('post_install_l10n', 'post_install', '-at_install')
@@ -106,15 +106,15 @@ def test_01_pos_order_with_swiss_qr_payment_fail(self):
106106
"""
107107
self.main_pos_config.with_user(self.pos_user).open_ui()
108108

109-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPaymentFailure', login="pos_user")
109+
self.start_pos_tour('PaymentScreenWithQRPaymentFailure')
110110

111111
def test_02_pos_order_with_swiss_qr_payment(self):
112112
""" Test Point of Sale QR Payment flow with Swiss QR
113113
We have to select a customer based in Switzerland or Lichtestein to use this payment method
114114
"""
115115
self.main_pos_config.with_user(self.pos_user).open_ui()
116116

117-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPaymentSwiss', login="pos_user")
117+
self.start_pos_tour('PaymentScreenWithQRPaymentSwiss')
118118

119119

120120
@tagged('post_install_l10n', 'post_install', '-at_install')
@@ -158,7 +158,7 @@ def test_01_pos_order_with_fps_qr_payment_fail(self):
158158
"""
159159
self.main_pos_config.with_user(self.pos_user).open_ui()
160160

161-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPaymentFailure', login="pos_user")
161+
self.start_pos_tour('PaymentScreenWithQRPaymentFailure')
162162

163163
def test_02_pos_order_with_emv_qr_payment(self):
164164
""" Test Point of Sale QR Payment flow with FPS.
@@ -173,7 +173,7 @@ def test_02_pos_order_with_emv_qr_payment(self):
173173

174174
self.main_pos_config.with_user(self.pos_user).open_ui()
175175

176-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPayment', login="pos_user")
176+
self.start_pos_tour('PaymentScreenWithQRPayment')
177177

178178

179179
@tagged('post_install_l10n', 'post_install', '-at_install')
@@ -213,7 +213,7 @@ def test_01_pos_order_with_pix_qr_payment_fail(self):
213213
"""
214214
self.main_pos_config.with_user(self.pos_user).open_ui()
215215

216-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPaymentFailure', login="pos_user")
216+
self.start_pos_tour('PaymentScreenWithQRPaymentFailure')
217217

218218
def test_02_pos_order_with_pix_qr_payment(self):
219219
""" Test Point of Sale QR Payment flow with PIX
@@ -228,4 +228,4 @@ def test_02_pos_order_with_pix_qr_payment(self):
228228

229229
self.main_pos_config.with_user(self.pos_user).open_ui()
230230

231-
self.start_tour("/pos/ui/%d" % self.main_pos_config.id, 'PaymentScreenWithQRPayment', login="pos_user")
231+
self.start_pos_tour('PaymentScreenWithQRPayment')

0 commit comments

Comments
 (0)