2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-24 09:57:40 +00:00
This commit is contained in:
Matthias Mair
2025-10-13 08:17:55 +02:00
parent f32bbc2c49
commit 0fde658a61

View File

@@ -1189,6 +1189,34 @@ class BuildListTest(BuildAPITest):
self.assertEqual(len(builds), 20)
def test_output_options(self):
"""Test the output options for BuildOrderList list."""
test_cases = [
('user_detail', 'responsible_detail'),
('project_code_detail', 'project_code_detail'),
]
for param, field in test_cases:
# Test with parameter set to 'true'
response = self.get(
self.url, {param: 'true', 'limit': 1}, expected_code=200
)
self.assertIn(
field,
response.data['results'][0],
f"Field '{field}' should be present when {param}='true'",
)
# Test with parameter set to 'false'
response = self.get(
self.url, {param: 'false', 'limit': 1}, expected_code=200
)
self.assertNotIn(
field,
response.data['results'][0],
f"Field '{field}' should not be present when {param}='false'",
)
class BuildOutputCreateTest(BuildAPITest):
"""Unit test for creating build output via API."""