2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Add unit tests for boolean user settings (via the API)

This commit is contained in:
Oliver Walters
2022-05-01 20:20:32 +10:00
parent 75fa0bed26
commit eabe082f0a
3 changed files with 100 additions and 6 deletions

View File

@ -17,8 +17,6 @@ def assign_bom_items(apps, schema_editor):
BuildItem = apps.get_model('build', 'builditem')
BomItem = apps.get_model('part', 'bomitem')
Part = apps.get_model('part', 'part')
logger.info("Assigning BomItems to existing BuildItem objects")
count_valid = 0
count_total = 0
@ -29,6 +27,10 @@ def assign_bom_items(apps, schema_editor):
# Note: Before this migration, variant stock assignment was not allowed,
# so BomItem lookup should be pretty easy
if count_total == 0:
# First time around
logger.info("Assigning BomItems to existing BuildItem objects")
count_total += 1
try: