From 4f0efec39f4be995c896b6a506b034b16719ee32 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sat, 25 Apr 2020 23:24:00 +1000 Subject: [PATCH] PEP and unit testing fixes --- InvenTree/build/fixtures/build.yaml | 10 +++++++++- InvenTree/build/tests.py | 2 +- InvenTree/stock/models.py | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/InvenTree/build/fixtures/build.yaml b/InvenTree/build/fixtures/build.yaml index c46afe625c..47e77dff07 100644 --- a/InvenTree/build/fixtures/build.yaml +++ b/InvenTree/build/fixtures/build.yaml @@ -10,6 +10,10 @@ status: 10 # PENDING creation_date: '2019-03-16' link: http://www.google.com + level: 0 + lft: 0 + rght: 0 + tree_id: 0 - model: build.build fields: @@ -19,4 +23,8 @@ status: 40 # COMPLETE quantity: 21 notes: 'Some more simple notes' - creation_date: '2019-03-16' \ No newline at end of file + creation_date: '2019-03-16' + level: 0 + lft: 0 + rght: 0 + tree_id: 1 \ No newline at end of file diff --git a/InvenTree/build/tests.py b/InvenTree/build/tests.py index acd614425a..42b953fe20 100644 --- a/InvenTree/build/tests.py +++ b/InvenTree/build/tests.py @@ -39,7 +39,7 @@ class BuildTestSimple(TestCase): self.assertEqual(b.batch, 'B2') self.assertEqual(b.quantity, 21) - self.assertEqual(str(b), 'Build 21 x Orphan - A part without a category') + self.assertEqual(str(b), '21 x Orphan') def test_url(self): b1 = Build.objects.get(pk=1) diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 5607854589..cc2c08b2d0 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -433,7 +433,6 @@ class StockItem(MPTTModel): return max(self.quantity - self.allocation_count(), 0) - def can_delete(self): """ Can this stock item be deleted? It can NOT be deleted under the following circumstances: