From 2090a4d417d60bf83c196955a5018950b455b776 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 15 May 2022 17:14:03 +0200 Subject: [PATCH] add in static label test --- InvenTree/label/tests.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/InvenTree/label/tests.py b/InvenTree/label/tests.py index ad1aaba9c8..53724a36fc 100644 --- a/InvenTree/label/tests.py +++ b/InvenTree/label/tests.py @@ -7,12 +7,13 @@ import os from django.conf import settings from django.apps import apps +from django.urls import reverse from django.core.exceptions import ValidationError from InvenTree.helpers import validateFilterString from InvenTree.api_tester import InvenTreeAPITestCase -from .models import StockItemLabel, StockLocationLabel +from .models import StockItemLabel, StockLocationLabel, PartLabel from stock.models import StockItem @@ -85,3 +86,13 @@ class LabelTest(InvenTreeAPITestCase): with self.assertRaises(ValidationError): validateFilterString(bad_filter_string, model=StockItem) + + def test_label_rendering(self): + """Test label rendering""" + + labels = PartLabel.objects.all() + part = PartLabel.objects.first() + + for label in labels: + url = reverse('api-part-label-print', kwargs={'pk': label.pk}) + self.get(f'{url}?parts={part.pk}', expected_code=200)