Improve unit testing for StockItem API

This commit is contained in:
Oliver Walters committed 2021-01-04 01:22:43 +11:00
1 parent a0c95579b4
commit d1ce0f062e
7 files changed
+189 -12

No files matched your search

+4 -2
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):