2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +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

@ -67,15 +67,18 @@ class StockTest(TestCase):
# Move one of the drawers
self.drawer3.parent = self.home
self.drawer3.save()
self.assertNotEqual(self.drawer3.parent, self.office)
self.assertEqual(self.drawer3.pathstring, 'Home/Drawer_3')
def test_children(self):
self.assertTrue(self.office.has_children)
self.assertFalse(self.drawer2.has_children)
childs = self.office.getUniqueChildren()
childs = [item.pk for item in self.office.getUniqueChildren()]
self.assertIn(self.drawer1.id, childs)
self.assertIn(self.drawer2.id, childs)