From 7c70fbe5b8411394704c5c78f3f6c8fdc384d63f Mon Sep 17 00:00:00 2001 From: Hetashree Chauhan Date: Wed, 19 Jun 2019 06:35:54 +0000 Subject: [PATCH] [IMP] stock: pass tests without demo data for file test_stock_location_search. pass all test cases without any demo data. If a user has not installed any demo data, then also test cases must not be break. task-2024202 closes : https://github.com/odoo/odoo/pull/34258 --- addons/stock/tests/test_stock_location_search.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/stock/tests/test_stock_location_search.py b/addons/stock/tests/test_stock_location_search.py index d19cfa8d775..ac83eebdfdc 100644 --- a/addons/stock/tests/test_stock_location_search.py +++ b/addons/stock/tests/test_stock_location_search.py @@ -7,10 +7,15 @@ class TestStockLocationSearch(common.TransactionCase): def setUp(self): super(TestStockLocationSearch, self).setUp() self.location = self.env['stock.location'] - self.location_barcode = self.env.ref('stock.stock_location_14') - self.location_barcode_id = self.location_barcode.id - self.barcode = self.location_barcode.barcode - self.name = self.location_barcode.name + self.stock_location = self.env.ref('stock.stock_location_stock') + self.sublocation = self.env['stock.location'].create({ + 'name': 'Shelf 2', + 'barcode': 1201985, + 'location_id': self.stock_location.id + }) + self.location_barcode_id = self.sublocation.id + self.barcode = self.sublocation.barcode + self.name = self.sublocation.name def test_10_location_search_by_barcode(self): """Search stock location by barcode"""