diff options
| author | Yannick Tivisse <yti@odoo.com> | 2019-11-04 16:45:59 +0100 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2019-11-05 16:18:10 +0100 |
| commit | 583c717fea3f83ea57b10ebf0ba3536fb0070d15 (patch) | |
| tree | 1fd77af0113bc7ca9e69c190e709078da2bc932c | |
| parent | 3c4a68f8d178f0ea88880bbefabceb74a99820d5 (diff) | |
[IMP] stock: Adapt tests to work with/without demo data
| -rw-r--r-- | addons/stock/tests/test_warehouse.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/addons/stock/tests/test_warehouse.py b/addons/stock/tests/test_warehouse.py index 859fe6de94d..f5ffd7b1907 100644 --- a/addons/stock/tests/test_warehouse.py +++ b/addons/stock/tests/test_warehouse.py @@ -452,6 +452,17 @@ class TestWarehouse(TestStockCommon): def test_noleak(self): # non-regression test to avoid company_id leaking to other warehouses (see blame) + partner = self.env['res.partner'].create({'name': 'Chicago partner'}) + company = self.env['res.company'].create({ + 'name': 'My Company (Chicago)1', + 'currency_id': self.ref('base.USD') + }) + self.env['stock.warehouse'].create({ + 'name': 'Chicago Warehouse2', + 'company_id': company.id, + 'code': 'Chic2', + 'partner_id': partner.id + }) wh = self.env["stock.warehouse"].search([]) assert len(set(wh.mapped("company_id.id"))) > 1 |
