def test_should_remove_presences(self) -> None: person = Person('P0') event = Event(None, Birth()) Presence(person, Subject(), event) anonymize_person(person) self.assertEquals(0, len(person.presences)) self.assertEquals(0, len(event.presences))
def test_should_remove_citations(self) -> None: person = Person('P0') source = Source('The Source') citation = Citation(None, source) person.citations.append(citation) anonymize_person(person) self.assertEquals(0, len(person.citations))
def test_should_remove_names(self) -> None: person = Person('P0') name = PersonName(person, 'Jane', 'Dough') source = Source('The Source') citation = Citation(None, source) name.citations.append(citation) anonymize_person(person) self.assertEquals(0, len(person.names)) self.assertEquals(0, len(citation.facts))
def test_should_not_remove_parents_with_public_descendants(self) -> None: person = Person('P0') person.private = True child = Person('P1') child.private = False person.children.append(child) parent = Person('P2') parent.private = True person.parents.append(parent) anonymize_person(person) self.assertCountEqual([parent], person.parents)
def test_should_remove_files(self) -> None: person = Person('P0') person.files.append(File('F0', __file__)) anonymize_person(person) self.assertEquals(0, len(person.files))