mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add unit test to check an "empty" (null) barcode can be supplied
This commit is contained in:
parent
1520c296dd
commit
30684685f9
@ -242,6 +242,7 @@ class POLineItemReceiveSerializer(serializers.Serializer):
|
||||
help_text=_('Unique identifier field'),
|
||||
default='',
|
||||
required=False,
|
||||
allow_null=True,
|
||||
allow_blank=True,
|
||||
)
|
||||
|
||||
|
@ -349,6 +349,31 @@ class PurchaseOrderReceiveTest(OrderTest):
|
||||
# No new stock items have been created
|
||||
self.assertEqual(self.n, StockItem.objects.count())
|
||||
|
||||
def test_null_barcode(self):
|
||||
"""
|
||||
Test than a "null" barcode field can be provided
|
||||
"""
|
||||
|
||||
# Set stock item barcode
|
||||
item = StockItem.objects.get(pk=1)
|
||||
item.save()
|
||||
|
||||
# Test with "null" value
|
||||
self.post(
|
||||
self.url,
|
||||
{
|
||||
'items': [
|
||||
{
|
||||
'line_item': 1,
|
||||
'quantity': 50,
|
||||
'barcode': None,
|
||||
}
|
||||
],
|
||||
'location': 1,
|
||||
},
|
||||
expected_code=201
|
||||
)
|
||||
|
||||
def test_invalid_barcodes(self):
|
||||
"""
|
||||
Tests for checking in items with invalid barcodes:
|
||||
|
Loading…
Reference in New Issue
Block a user