Beispiel #1
0
 def test_privatize_person_should_privatize_if_private(self):
     source_file = File('F0', __file__)
     source = Source('The Source')
     source.files.append(source_file)
     citation_file = File('F1', __file__)
     citation = IdentifiableCitation('C0', source)
     citation.files.append(citation_file)
     event_as_subject = Event(Birth())
     event_as_attendee = Event(Marriage())
     person_file = File('F2', __file__)
     person = Person('P0')
     person.private = True
     person.citations.append(citation)
     person.files.append(person_file)
     Presence(person, Subject(), event_as_subject)
     Presence(person, Attendee(), event_as_attendee)
     privatize_person(person, 125)
     self.assertTrue(person.private)
     self.assertTrue(citation.private)
     self.assertTrue(source.private)
     self.assertTrue(person_file.private)
     self.assertTrue(citation_file.private)
     self.assertTrue(source_file.private)
     self.assertTrue(event_as_subject.private)
     self.assertIsNone(event_as_attendee.private)
Beispiel #2
0
 def test_privatize_person_without_relatives(self, expected, private, event: Optional[Event]):
     person = Person('P0')
     person.private = private
     if event is not None:
         Presence(person, Subject(), event)
     privatize_person(person, 125)
     self.assertEquals(expected, person.private)
Beispiel #3
0
 def test_privatize_person_with_parent(self, expected, private, event: Optional[Event]):
     person = Person('P0')
     person.private = private
     parent = Person('P1')
     if event is not None:
         Presence(parent, Subject(), event)
     person.parents.append(parent)
     privatize_person(person, 125)
     self.assertEquals(expected, person.private)
Beispiel #4
0
 def test_privatize_person_with_child(self, expected, private, event: Optional[Event]):
     person = Person('P0')
     person.private = private
     child = Person('P1')
     if event is not None:
         Presence(child, Subject(), event)
     person.children.append(child)
     privatize_person(person, 125)
     self.assertEquals(expected, person.private)