From 95fadf130080a34a2d0d95fb251ba11ba4294265 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 30 Oct 2020 23:08:12 +1100 Subject: [PATCH] Update unit testing --- InvenTree/part/templates/part/bom.html | 5 ----- InvenTree/stock/fixtures/stock.yaml | 2 ++ InvenTree/stock/tests.py | 5 +++++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/InvenTree/part/templates/part/bom.html b/InvenTree/part/templates/part/bom.html index a79e8b4dc2..1fa4b1931f 100644 --- a/InvenTree/part/templates/part/bom.html +++ b/InvenTree/part/templates/part/bom.html @@ -12,11 +12,6 @@

{% trans "Bill of Materials" %}

-{% if part.has_complete_bom_pricing == False %} -
- The BOM for {{ part.full_name }} does not have complete pricing information -
-{% endif %} {% if part.bom_checked_date %} {% if part.is_bom_valid %}
diff --git a/InvenTree/stock/fixtures/stock.yaml b/InvenTree/stock/fixtures/stock.yaml index dd528775eb..79b3585420 100644 --- a/InvenTree/stock/fixtures/stock.yaml +++ b/InvenTree/stock/fixtures/stock.yaml @@ -41,6 +41,7 @@ - model: stock.stockitem pk: 100 fields: + batch: "B1234" part: 25 location: 7 quantity: 10 @@ -54,6 +55,7 @@ pk: 101 fields: part: 25 + batch: "B2345" location: 7 quantity: 5 level: 0 diff --git a/InvenTree/stock/tests.py b/InvenTree/stock/tests.py index 4632505831..199a99121e 100644 --- a/InvenTree/stock/tests.py +++ b/InvenTree/stock/tests.py @@ -197,6 +197,10 @@ class StockTest(TestCase): def test_partial_move(self): w1 = StockItem.objects.get(pk=100) + # A batch code is required to split partial stock! + w1.batch = 'BW1' + w1.save() + # Move 6 of the units self.assertTrue(w1.move(self.diningroom, 'Moved', None, quantity=6)) @@ -339,6 +343,7 @@ class StockTest(TestCase): # Item will deplete when deleted item = StockItem.objects.get(pk=100) item.delete_on_deplete = True + item.save() n = StockItem.objects.filter(part=25).count()