From f02affbdf93abb11af6c5b025af7ced01789bce4 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 21 Sep 2017 21:11:25 +0200 Subject: [PATCH] Fix failing test * Rename it because it was shadowing another test * Compute in the location's context --- connector_magento/tests/test_export_product_stock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connector_magento/tests/test_export_product_stock.py b/connector_magento/tests/test_export_product_stock.py index 1a5fbfa6f..bca93fec8 100644 --- a/connector_magento/tests/test_export_product_stock.py +++ b/connector_magento/tests/test_export_product_stock.py @@ -182,7 +182,7 @@ def test_export_product_inventory_write_job(self): self.parse_cassette_request(cassette.requests[1].body) ) - def test_compute_new_qty(self): + def test_compute_new_qty_with_location(self): product = self.binding_product.odoo_id binding = self.binding_product # start with 0 @@ -190,6 +190,7 @@ def test_compute_new_qty(self): self.assertEqual(binding.magento_qty, 0.0) my_location_id = self.env.ref("stock.stock_location_components").id + binding = binding.with_context(location=my_location_id) # change to 30 self._product_change_qty(product, 30)