mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Return data as a list of dict objects
This commit is contained in:
parent
a44267c306
commit
3488da19b0
@ -242,4 +242,15 @@ class InvenTreeAPITestCase(APITestCase):
|
||||
if required_rows is not None:
|
||||
self.assertEqual(len(rows), required_rows)
|
||||
|
||||
return (headers, rows)
|
||||
# Return the file data as a list of dict items, based on the headers
|
||||
data = []
|
||||
|
||||
for row in rows:
|
||||
entry = {}
|
||||
|
||||
for idx, col in enumerate(headers):
|
||||
entry[col] = row[idx]
|
||||
|
||||
data.append(entry)
|
||||
|
||||
return data
|
||||
|
Loading…
Reference in New Issue
Block a user