def test_unmatch_snapshot_tree_last_match(self):
        self._add_additional_fake_buildings()

        # simulate matching bs1 and bs2 to have a child of bs3
        self.bs1.children.add(self.bs3)
        self.bs2.children.add(self.bs3)

        canon = self.bs1.canonical_building
        canon2 = self.bs2.canonical_building
        canon2.active = False
        canon2.save()

        self.bs3.canonical_building = canon
        self.bs3.save()
        canon.canonical_snapshot = self.bs3
        canon.save()

        # unmatch bs2 from bs1
        seed_models.unmatch_snapshot_tree(self.bs2.pk)

        canon = seed_models.CanonicalBuilding.objects.get(pk=canon.pk)
        canon2 = seed_models.CanonicalBuilding.objects.get(pk=canon2.pk)
        bs1 = seed_models.BuildingSnapshot.objects.get(pk=self.bs1.pk)
        bs2 = seed_models.BuildingSnapshot.objects.get(pk=self.bs2.pk)

        self.assertEqual(canon.canonical_snapshot, bs1)
        self.assertEqual(bs1.children.count(), 0)
        self.assertEqual(canon2.active, True)
Tests the simplest case of unmatching a building where the child
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/tests/test_models.py/TestBuildingSnapshot.test_unmatch_snapshot_tree_last_match