Quick fix for unit test (#5920)

- Sometimes the items are returned in a different order, maybe?

(cherry picked from commit 849f52a1af)
This commit is contained in:
Oliver 2023-11-15 13:18:49 +11:00 committed by GitHub
parent 2234357e63
commit dedf50da62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -731,8 +731,11 @@ class StockItemListTest(StockAPITestCase):
) )
self.assertEqual(len(response.data), 2) 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): def test_query_count(self):
"""Test that the number of queries required to fetch stock items is reasonable.""" """Test that the number of queries required to fetch stock items is reasonable."""