def test_children6(self):
        th = TestHelper()
        # add a top level prefix
        p1 = th.add_prefix('1.0.0.0/24', 'assignment', 'test')
        p2 = th.add_prefix('2.0.0.0/25', 'reservation', 'bar')
        # now move our supernet, so we see that the update thingy works
        p2.prefix = '2.0.0.0/22'
        p2.save()

        # check stats for p2, we shouldn't see children based on our old
        # position (2.0.0.0/25)
        res = Prefix.smart_search('2.0.0.0/22', {})
        self.assertEqual(0, res['result'][0].children)

        # now move our supernet, so we see that the update thingy works
        p2.prefix = '1.0.0.0/22'
        p2.save()

        # check stats for p2, we should get p1 as child
        res = Prefix.smart_search('1.0.0.0/22', {})
        self.assertEqual(1, res['result'][0].children)
Check children are correct when moving prefix
dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipaptest.py/TestPrefixChildren.test_children6