Skip to content

Commit

Permalink
[MIG] test_pos2023: 14.0 -> 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
em230418 committed Mar 10, 2024
1 parent fdc1ceb commit e4d677c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test_pos2023/tests/test_session_close.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ def setUp(self):

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

# В первом POS открываем сессию
self.config = config1
self.config = self._create_basic_config()
self.open_new_session()
session1 = self.pos_session

Expand All @@ -39,7 +37,7 @@ def test_late_session_close(self):
orders.append(
self.create_ui_order_data(
[(self.product1, 1)],
payments=[(self.cash_pm, 10)],
payments=[(self.cash_pm1, 10)],
)
)

Expand All @@ -48,14 +46,14 @@ def test_late_session_close(self):
# Не закрываем сессию в первом POS
# и открываем и закрываем много сессий на втором POS-е
# в каждой сессии также по одному заказу оплачиваем наличкой
self.config = config2
self.config = self._create_basic_config()

for i in range(1000):
_logger.info("%s: running session %s" % (method_name, i))
self.open_new_session()
order = self.create_ui_order_data(
[(self.product1, 1)],
payments=[(self.cash_pm, 10)],
payments=[(self.cash_pm1, 10)],
)
self.env["pos.order"].create_from_ui([order])
self.pos_session.action_pos_session_validate()
Expand All @@ -66,9 +64,9 @@ def test_late_session_close(self):

def test_1000_pos_configs(self):
method_name = inspect.currentframe().f_code.co_name
configs = [self._create_basic_config() for x in range(1000)]

for i, pos in enumerate(configs):
for i in range(1000):
pos = self._create_basic_config()
# открываем очередную кассу
_logger.info("%s: running session %s" % (method_name, i))
self.config = pos
Expand All @@ -79,7 +77,7 @@ def test_1000_pos_configs(self):
orders.append(
self.create_ui_order_data(
[(self.product1, 1)],
payments=[(self.cash_pm, 10)],
payments=[(self.cash_pm1, 10)],
)
)
self.env["pos.order"].create_from_ui(orders)
Expand Down

0 comments on commit e4d677c

Please sign in to comment.