2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Add function to get all test results as a map

- This will be required for pushing out to a test report
This commit is contained in:
Oliver Walters
2020-05-16 20:45:10 +10:00
parent 2bb9fd9955
commit df91b8cf4d
3 changed files with 54 additions and 0 deletions

View File

@ -423,3 +423,11 @@ class TestResultTest(StockTest):
# Passing tests
self.assertEqual(item.getTestResults(result=True).count(), 3)
self.assertEqual(item.getTestResults(result=False).count(), 1)
# Result map
result_map = item.testResultMap()
self.assertEqual(len(result_map), 3)
for test in ['Firmware Version', 'Settings Checksum', 'Temperature Test']:
self.assertIn(test, result_map.keys())