mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 04:00:57 +00:00
Bump deps (#5385)
* bump deps * use isinstance where possible * and another bump ;-) * small fix for isinstance * fixed wrong comparison * fixed comparision * use exact comparision
This commit is contained in:
@ -377,7 +377,7 @@ class BuildReport(ReportTemplateBase):
|
||||
"""Custom context data for the build report."""
|
||||
my_build = self.object_to_print
|
||||
|
||||
if type(my_build) != build.models.Build:
|
||||
if not isinstance(my_build, build.models.Build):
|
||||
raise TypeError('Provided model is not a Build object')
|
||||
|
||||
return {
|
||||
@ -653,7 +653,7 @@ class StockLocationReport(ReportTemplateBase):
|
||||
"""Return custom context data for the StockLocationReport template"""
|
||||
stock_location = self.object_to_print
|
||||
|
||||
if type(stock_location) != stock.models.StockLocation:
|
||||
if not isinstance(stock_location, stock.models.StockLocation):
|
||||
raise TypeError('Provided model is not a StockLocation object -> ' + str(type(stock_location)))
|
||||
|
||||
return {
|
||||
|
@ -168,12 +168,12 @@ class BarcodeTagTest(TestCase):
|
||||
|
||||
barcode = barcode_tags.barcode("12345")
|
||||
|
||||
self.assertTrue(type(barcode) == str)
|
||||
self.assertTrue(isinstance(barcode, str))
|
||||
self.assertTrue(barcode.startswith('data:image/png;'))
|
||||
|
||||
# Try with a different format
|
||||
barcode = barcode_tags.barcode('99999', format='BMP')
|
||||
self.assertTrue(type(barcode) == str)
|
||||
self.assertTrue(isinstance(barcode, str))
|
||||
self.assertTrue(barcode.startswith('data:image/bmp;'))
|
||||
|
||||
def test_qrcode(self):
|
||||
@ -181,7 +181,7 @@ class BarcodeTagTest(TestCase):
|
||||
|
||||
# Test with default settings
|
||||
qrcode = barcode_tags.qrcode("hello world")
|
||||
self.assertTrue(type(qrcode) == str)
|
||||
self.assertTrue(isinstance(qrcode, str))
|
||||
self.assertTrue(qrcode.startswith('data:image/png;'))
|
||||
self.assertEqual(len(qrcode), 700)
|
||||
|
||||
@ -192,7 +192,7 @@ class BarcodeTagTest(TestCase):
|
||||
box_size=50,
|
||||
format='BMP',
|
||||
)
|
||||
self.assertTrue(type(qrcode) == str)
|
||||
self.assertTrue(isinstance(qrcode, str))
|
||||
self.assertTrue(qrcode.startswith('data:image/bmp;'))
|
||||
self.assertEqual(len(qrcode), 309720)
|
||||
|
||||
|
Reference in New Issue
Block a user