mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +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'),
|
help_text=_('Unique identifier field'),
|
||||||
default='',
|
default='',
|
||||||
required=False,
|
required=False,
|
||||||
|
allow_null=True,
|
||||||
allow_blank=True,
|
allow_blank=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -349,6 +349,31 @@ class PurchaseOrderReceiveTest(OrderTest):
|
|||||||
# No new stock items have been created
|
# No new stock items have been created
|
||||||
self.assertEqual(self.n, StockItem.objects.count())
|
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):
|
def test_invalid_barcodes(self):
|
||||||
"""
|
"""
|
||||||
Tests for checking in items with invalid barcodes:
|
Tests for checking in items with invalid barcodes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user