From 8724702fef72176d44987e663dbd1b57550bc033 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 13 Feb 2022 22:39:29 +0100 Subject: [PATCH] add coverage for labels --- InvenTree/label/test_api.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/InvenTree/label/test_api.py b/InvenTree/label/test_api.py index af4c0782ec..79442cc72c 100644 --- a/InvenTree/label/test_api.py +++ b/InvenTree/label/test_api.py @@ -66,3 +66,38 @@ class TestReportTests(InvenTreeAPITestCase): 'items': [10, 11, 12], } ) + +class TestLabels(InvenTreeAPITestCase): + """ + Tests for the StockItem TestReport templates + """ + + fixtures = [ + 'category', + 'part', + 'location', + 'stock', + ] + + roles = [ + 'stock.view', + 'stock_location.view', + ] + + def do_list(self, filters={}): + + response = self.client.get(self.list_url, filters, format='json') + + self.assertEqual(response.status_code, 200) + + return response.data + + def test_lists(self): + self.list_url = reverse('api-stockitem-label-list') + self.do_list() + + self.list_url = reverse('api-stocklocation-label-list') + self.do_list() + + self.list_url = reverse('api-part-label-list') + self.do_list()