From dedf50da62cc70cc71ff0bda8b0521ee8e854d5a Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 15 Nov 2023 13:18:49 +1100 Subject: [PATCH] Quick fix for unit test (#5920) - Sometimes the items are returned in a different order, maybe? (cherry picked from commit 849f52a1af8e943af6c3ec98ee5e584b3eeff95f) --- InvenTree/stock/test_api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/InvenTree/stock/test_api.py b/InvenTree/stock/test_api.py index 46ee953f4c..6f6165f68e 100644 --- a/InvenTree/stock/test_api.py +++ b/InvenTree/stock/test_api.py @@ -731,8 +731,11 @@ class StockItemListTest(StockAPITestCase): ) self.assertEqual(len(response.data), 2) - self.assertEqual(response.data[0]["pk"], stock_1.pk) - self.assertEqual(response.data[1]["pk"], stock_2.pk) + + ids = [item["pk"] for item in response.data] + + self.assertIn(stock_1.pk, ids) + self.assertIn(stock_2.pk, ids) def test_query_count(self): """Test that the number of queries required to fetch stock items is reasonable."""