Fixes for unit testing

(cherry picked from commit eb3b5308ab)
This commit is contained in:
Oliver Walters 2020-04-13 19:51:13 +10:00
parent 8fa3d77416
commit 307dd25f87
3 changed files with 4 additions and 3 deletions

View File

@ -168,6 +168,10 @@ class Company(models.Model):
""" The number of parts manufactured (or supplied) by this Company """
return self.parts.count()
@property
def has_parts(self):
return self.part_count > 0
@property
def stock_items(self):
""" Return a list of all stock items supplied or manufactured by this company """

View File

@ -77,7 +77,6 @@ class CompanyIndex(ListView):
context = None
for item in lookup:
print(self.request.path, item)
if self.request.path == item:
context = lookup[item]
break

View File

@ -1268,8 +1268,6 @@ class PartExport(AjaxView):
# Filter by part category
cat_id = request.GET.get('category', None)
print('cat_id:', cat_id)
part_list = None
if cat_id is not None: