2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

Adds unit testing for fancy new metadata class

This commit is contained in:
Oliver
2021-06-23 20:58:05 +10:00
parent eaa5913c8c
commit 82a6ff7772
6 changed files with 119 additions and 21 deletions

View File

@ -1,8 +1,13 @@
# Generated by Django 3.2 on 2021-06-01 05:25
import logging
from django.db import migrations
logger = logging.getLogger('inventree')
def assign_bom_items(apps, schema_editor):
"""
Run through existing BuildItem objects,
@ -13,7 +18,7 @@ def assign_bom_items(apps, schema_editor):
BomItem = apps.get_model('part', 'bomitem')
Part = apps.get_model('part', 'part')
print("Assigning BomItems to existing BuildItem objects")
logger.info("Assigning BomItems to existing BuildItem objects")
count_valid = 0
count_total = 0
@ -41,7 +46,7 @@ def assign_bom_items(apps, schema_editor):
pass
if count_total > 0:
print(f"Assigned BomItem for {count_valid}/{count_total} entries")
logger.info(f"Assigned BomItem for {count_valid}/{count_total} entries")
def unassign_bom_items(apps, schema_editor):