2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Improve unit testing for StockItem API

This commit is contained in:
Oliver Walters
2021-01-04 01:17:05 +11:00
parent a0c95579b4
commit d1ce0f062e
7 changed files with 189 additions and 12 deletions

View File

@ -177,8 +177,10 @@ class StockTest(TestCase):
# There should be 9000 screws in stock
self.assertEqual(part.total_stock, 9000)
# There should be 18 widgets in stock
self.assertEqual(StockItem.objects.filter(part=25).aggregate(Sum('quantity'))['quantity__sum'], 19)
# There should be 16 widgets "in stock"
self.assertEqual(
StockItem.objects.filter(part=25).aggregate(Sum('quantity'))['quantity__sum'], 16
)
def test_delete_location(self):