mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
Add test for very large serial number
This commit is contained in:
parent
09ff4862ec
commit
ac512cb8bb
@ -405,6 +405,12 @@ class StockTest(TestCase):
|
|||||||
item.serial = "-123"
|
item.serial = "-123"
|
||||||
item.save()
|
item.save()
|
||||||
|
|
||||||
|
# Test a very very large value
|
||||||
|
item.serial = '99999999999999999999999999999999999999999999999999999'
|
||||||
|
item.save()
|
||||||
|
|
||||||
|
self.assertEqual(item.serial_int, 0x7fffffff)
|
||||||
|
|
||||||
# Negative number should map to zero
|
# Negative number should map to zero
|
||||||
self.assertEqual(item.serial_int, 0)
|
self.assertEqual(item.serial_int, 0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user