2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 11:05:41 +00:00

Fixed tests

- Tree classes now need extra configuration in the fixture
- Check for null pk when cleaning a tree node
This commit is contained in:
Oliver Walters
2019-09-08 19:41:54 +10:00
parent a5189b8f3f
commit dac61eafa2
6 changed files with 71 additions and 8 deletions

View File

@ -48,7 +48,7 @@ class CategoryTest(TestCase):
def test_unique_childs(self):
""" Test the 'unique_children' functionality """
childs = self.electronics.getUniqueChildren()
childs = [item.pk for item in self.electronics.getUniqueChildren()]
self.assertIn(self.transceivers.id, childs)
self.assertIn(self.ic.id, childs)
@ -58,7 +58,7 @@ class CategoryTest(TestCase):
def test_unique_parents(self):
""" Test the 'unique_parents' functionality """
parents = self.transceivers.getUniqueParents()
parents = [item.pk for item in self.transceivers.getUniqueParents()]
self.assertIn(self.electronics.id, parents)
self.assertIn(self.ic.id, parents)