Skip to content

Commit

Permalink
[MIG] connector_ecommerce: FIX test
Browse files Browse the repository at this point in the history
  • Loading branch information
asierneiradev committed Feb 23, 2023
1 parent 6c442ec commit 6296375
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions connector_ecommerce/tests/test_onchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

import odoo.tests.common as common

from odoo.addons.component.tests.common import TransactionComponentRegistryCase
from odoo.addons.component.core import ComponentRegistry

from ..components.sale_order_onchange import OnChangeManager, SaleOrderOnChange

DB = common.DB
ADMIN_USER_ID = common.ADMIN_USER_ID


class TestOnchange(TransactionComponentRegistryCase):
class TestOnchange(ComponentRegistry):
"""Test if the onchanges are applied correctly on a sales order"""

def setUp(self):
Expand Down
8 changes: 4 additions & 4 deletions connector_ecommerce/tests/test_picking_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def setUp(self):
)
self.sale.action_confirm()
self.picking = self.sale.picking_ids
self.location_id = self.picking.move_lines[0].location_id.id
self.location_dest_id = self.picking.move_lines[0].location_dest_id.id
self.location_id = self.picking.move_line_ids[0].location_id.id
self.location_dest_id = self.picking.move_line_ids[0].location_dest_id.id

def test_event_on_picking_out_done(self):
"""Test if the ``on_picking_out_done`` event is fired
Expand All @@ -68,7 +68,7 @@ def test_event_on_picking_out_done(self):
with mock.patch(mock_method) as mock_event:
self.picking.action_confirm()
self.picking.action_assign()
for move in self.picking.move_lines:
for move in self.picking.move_ids:
move.move_line_ids.qty_done = move.product_qty
self.picking._action_done()
self.assertEqual(self.picking.state, "done")
Expand All @@ -83,7 +83,7 @@ def test_event_on_picking_out_done_partial(self):
with mock.patch(mock_method) as mock_event:
self.picking.action_confirm()
self.picking.action_assign()
self.picking.move_lines.move_line_ids.qty_done = 1.0
self.picking.move_line_ids.qty_done = 1.0
self.picking._action_done()
self.assertEqual(self.picking.state, "done")
mock_event("on_picking_out_done").notify.assert_called_with(
Expand Down

0 comments on commit 6296375

Please sign in to comment.