def test_create_child(self):

        bs1 = seed_models.BuildingSnapshot.objects.create()
        bs2 = seed_models.BuildingSnapshot.objects.create()

        bs1.children.add(bs2)

        self.assertEqual(bs1.children.all()[0], bs2)
        self.assertEqual(bs2.parents.all()[0], bs1)
        self.assertEqual(list(bs1.parents.all()), [])
        self.assertEqual(list(bs2.children.all()), [])
Child BS has reference to parent.
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/tests/test_models.py/TestBuildingSnapshot.test_create_child