2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Make serial number suggestion DB independent, handle mixed types more cleanly and test

This commit is contained in:
Ben Charlton
2020-08-24 19:49:32 +01:00
parent 471ece136e
commit d5a374f1fd
2 changed files with 20 additions and 11 deletions

View File

@ -391,6 +391,11 @@ class VariantTest(StockTest):
with self.assertRaises(ValidationError):
item.save()
# Verify items with a non-numeric serial don't offer a next serial.
item.serial="string"
item.save()
self.assertEqual(variant.getNextSerialNumber(), None)
# This should pass, although not strictly an int field now.
item.serial = int(n) + 1
item.save()