Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
* Rename it because it was shadowing another test
* Compute in the location's context
  • Loading branch information
guewen committed Sep 21, 2017
1 parent 482d321 commit f02affb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion connector_magento/tests/test_export_product_stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,15 @@ 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
self.assertEqual(product.virtual_available, 0.0)
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)
Expand Down

0 comments on commit f02affb

Please sign in to comment.