From 43e03ed02306c7e29420a372223411dfbb39d9ea Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 1 Feb 2021 12:26:58 +1100 Subject: [PATCH] Update unit tests --- InvenTree/barcode/barcode.py | 2 ++ InvenTree/part/test_part.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/barcode/barcode.py b/InvenTree/barcode/barcode.py index 3837fef599..004182e0be 100644 --- a/InvenTree/barcode/barcode.py +++ b/InvenTree/barcode/barcode.py @@ -25,6 +25,8 @@ def hash_barcode(barcode_data): TODO: Work out a way around this! """ + barcode_data = str(barcode_data).strip() + printable_chars = filter(lambda x: x in string.printable, barcode_data) barcode_data = ''.join(list(printable_chars)) diff --git a/InvenTree/part/test_part.py b/InvenTree/part/test_part.py index 4c08911122..030d7faf4e 100644 --- a/InvenTree/part/test_part.py +++ b/InvenTree/part/test_part.py @@ -100,7 +100,7 @@ class PartTest(TestCase): self.assertEqual(r.available_stock, 0) def test_barcode(self): - barcode = self.r1.format_barcode() + barcode = self.r1.format_barcode(brief=False) self.assertIn('InvenTree', barcode) self.assertIn(self.r1.name, barcode)