mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-13 08:21:26 +00:00
Refactor how form errors are handled
- When in doubt, refer to the django docs - There was a *much* better way (thanks, form.add_error)! - The anti-pattern was deleted, and lo, there was much rejoicing - Some other refactoring too
This commit is contained in:
@ -407,6 +407,13 @@ class VariantTest(StockTest):
|
||||
|
||||
self.assertEqual(chair.getLatestSerialNumber(), '22')
|
||||
|
||||
# Check for conflicting serial numbers
|
||||
to_check = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||
|
||||
conflicts = chair.find_conflicting_serial_numbers(to_check)
|
||||
|
||||
self.assertEqual(len(conflicts), 6)
|
||||
|
||||
# Same operations on a sub-item
|
||||
variant = Part.objects.get(pk=10003)
|
||||
self.assertEqual(variant.getLatestSerialNumber(), '22')
|
||||
|
Reference in New Issue
Block a user