Skip to content

Commit

Permalink
[IMP] test_pos2023: добавили еще более реалистичный вариант теста tes…
Browse files Browse the repository at this point in the history
…t_late_session_close

В нем просто обозначают, что есть 1000 посов и каждый делает свой заказ
  • Loading branch information
em230418 committed Mar 9, 2024
1 parent 4c84254 commit c62c45c
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test_pos2023/tests/test_session_close.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import inspect

from odoo.tests import tagged

Expand Down Expand Up @@ -26,6 +27,8 @@ def setUp(self):
)

def test_late_session_close(self):
method_name = inspect.currentframe().f_code.co_name

# В первом POS открываем сессию
self.config = self.config1
self.open_new_session()
Expand All @@ -48,7 +51,7 @@ def test_late_session_close(self):
self.config = self.config2

for i in range(1000):
_logger.info("running session %s" % (i,))
_logger.info("%s: running session %s" % (method_name, i))
self.open_new_session()
order = self.create_ui_order_data(
[(self.product1, 1)],
Expand All @@ -60,3 +63,28 @@ def test_late_session_close(self):
# Ну а теперь попробуем закрывать самую первую сессию
_logger.info("closing very first session")
self.session1.action_pos_session_validate()

def test_1000_pos_configs(self):
method_name = inspect.currentframe().f_code.co_name

for i, pos in enumerate(self.configs):
_logger.info("%s: running session %s" % (method_name, i))
self.config = pos
self.open_new_session()
self.sessions.append(self.pos_session)

orders = []
orders.append(
self.create_ui_order_data(
[(self.product1, 1)],
payments=[(self.cash_pm, 10)],
)
)
self.env["pos.order"].create_from_ui(orders)

if i == 0:
first_session = self.pos_session
else:
self.pos_session.action_pos_session_validate()

first_session.action_pos_session_validate()

0 comments on commit c62c45c

Please sign in to comment.