create labels on startup

This commit is contained in:
Matthias 2022-05-18 23:23:34 +02:00
parent 041128ff9c
commit 444c8b871e
No known key found for this signature in database
GPG Key ID: AB6D0E6C4CB65093

View File

@ -10,6 +10,7 @@ from django.core.exceptions import ValidationError
from InvenTree.helpers import validateFilterString
from InvenTree.api_tester import InvenTreeAPITestCase
from .apps import LabelConfig
from .models import StockItemLabel, StockLocationLabel, PartLabel
from stock.models import StockItem
@ -87,6 +88,9 @@ class LabelTest(InvenTreeAPITestCase):
def test_label_rendering(self):
"""Test label rendering"""
# make sure the labels exsist
LabelConfig.create_labels()
labels = PartLabel.objects.all()
part = PartLabel.objects.first()