def test_should_remove_citations(self) -> None: person = Person('P0') source = Source('S0', 'The Source') citation = Citation('C0', source) person.citations.append(citation) anonymize_person(person) self.assertEquals(0, len(person.citations))
def test_should_not_remove_parents_with_public_descendants(self) -> None: person = Person('P0') 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_anonymize_person_should_anonymize_parents_if_public_with_public_descendants( self): person = Person('P0') person.private = False child = Person('P1') child.private = False person.children.add(child) parent = Person('P2') parent.private = True person.parents.add(parent) anonymize_person(person) self.assertCountEqual([parent], person.parents)
def test_should_remove_presences(self) -> None: person = Person('P0') Presence(person, Presence.Role.SUBJECT, Event(Event.Type.BIRTH)) anonymize_person(person) self.assertEquals(0, len(person.presences))
def test_should_remove_names(self) -> None: person = Person('P0') person.names.append(PersonName('Jane', 'Doughh')) anonymize_person(person) self.assertEquals(0, len(person.names))
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))