2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 21:45:39 +00:00

Fixed test cases

This commit is contained in:
Oliver Walters
2019-06-18 01:38:43 +10:00
parent ea0da4c8f8
commit a47be24410
3 changed files with 8 additions and 11 deletions

View File

@ -167,8 +167,7 @@ class PartList(generics.ListCreateAPIView):
if cat_id:
try:
category = PartCategory.objects.get(pk=cat_id)
cats = category.getUniqueChildren(include_self=True)
parts_list = parts_list.filter(category__in=cats)
parts_list = parts_list.filter(category__in=category.getUniqueChildren())
except PartCategory.DoesNotExist:
pass

View File

@ -82,10 +82,10 @@ class CategoryTest(TestCase):
self.assertTrue(self.fasteners.has_parts)
self.assertFalse(self.transceivers.has_parts)
self.assertEqual(self.fasteners.partcount, 2)
self.assertEqual(self.capacitors.partcount, 1)
self.assertEqual(self.fasteners.partcount(), 2)
self.assertEqual(self.capacitors.partcount(), 1)
self.assertEqual(self.electronics.partcount, 3)
self.assertEqual(self.electronics.partcount(), 3)
def test_delete(self):
""" Test that category deletion moves the children properly """