2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-03 15:52:51 +00:00

Bump required query time for testing (#10451)

Note: In "real life" the query does not take this long
This commit is contained in:
Oliver
2025-10-02 13:40:42 +10:00
committed by GitHub
parent bfd32c9864
commit 7b2b174ab2

View File

@@ -1421,17 +1421,19 @@ class BuildLineTests(BuildAPITest):
for line in lines:
StockItem.objects.create(part=line.bom_item.sub_part, quantity=60)
# TODO: 2025-10-02: Work out why this query takes so long with PostgreSQL (in CI)
# Note: The max_query_time is bumped up here, as postgresql backend has some strange issues (only during testing)
response = self.get(
url, {'build': build.pk, 'available': True}, max_query_time=15
url, {'build': build.pk, 'available': True}, max_query_time=30
)
# We expect 2 lines to have "available" stock
self.assertEqual(len(response.data), 2)
# TODO: 2025-10-02: Work out why this query takes so long with PostgreSQL (in CI)
# Note: The max_query_time is bumped up here, as postgresql backend has some strange issues (only during testing)
response = self.get(
url, {'build': build.pk, 'available': False}, max_query_time=15
url, {'build': build.pk, 'available': False}, max_query_time=30
)
self.assertEqual(len(response.data), 1)