Ejemplo n.º 1
0
 def test_split_name_double_last_name(self):
     instance = Person()
     instance.full_name = "Synthia Rosalie Frans van der Snoek (de Jong)"
     instance.split_full_name()
     self.assertEqual(instance.first_name, None)
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, None)
     instance = Person()
     instance.full_name = "Fako Berkers-Raaphorst"
     instance.split_full_name()
     self.assertEqual(instance.first_name, None)
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, None)
Ejemplo n.º 2
0
 def test_generic_split_name(self):
     instance = Person()
     instance.full_name = "Henk van der Spek"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Henk")
     self.assertEqual(instance.prefix, "van der")
     self.assertEqual(instance.last_name, "van der Spek")
     instance = Person()
     instance.full_name = "Fako Casper Berkers"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Fako Casper")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "Berkers")
     instance = Person()
     instance.full_name = "Lotte Beatrice van der Snoek"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Lotte Beatrice")
     self.assertEqual(instance.prefix, "van der")
     self.assertEqual(instance.last_name, "van der Snoek")
     instance = Person()
     instance.full_name = "Ellen BijsterBOSCH"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Ellen")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "BijsterBOSCH")
     instance = Person()
     instance.full_name = "Malou de Roy van Zuydewijn"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Malou")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "de Roy van Zuydewijn")
     instance = Person()
     instance.full_name = "Bart-Jan Dokter"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Bart-Jan")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "Dokter")
     instance = Person()
     instance.full_name = "Gert Sup?r"
     instance.split_full_name()
     self.assertEqual(instance.first_name, None)
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, None)
     instance = Person()
     instance.full_name = "zzzzz zzzzzzzz"
     instance.split_full_name()
     self.assertEqual(instance.first_name, None)
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, None)
     instance = Person()
     instance.full_name = "Zwarte Piet"
     instance.split_full_name()
     self.assertEqual(instance.first_name, None)
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, None)
     instance = Person()
     instance.full_name = "Frans Frans"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Frans")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "Frans")
     instance = Person()
     instance.full_name = "Bart 's Heeren Loo Midden-Nederland"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Bart")
     self.assertEqual(instance.prefix, "'s")
     self.assertEqual(instance.last_name, "'s Heeren Loo Midden-Nederland")
Ejemplo n.º 3
0
 def test_generic_split_name(self):
     instance = Person()
     instance.full_name = "Henk van der Spek"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Henk")
     self.assertEqual(instance.prefix, "van der")
     self.assertEqual(instance.last_name, "van der Spek")
     instance = Person()
     instance.full_name = "Fako Casper Berkers"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Fako Casper")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "Berkers")
     instance = Person()
     instance.full_name = "Ellen Bijsterbosch"
     instance.split_full_name()
     self.assertEqual(instance.first_name, "Ellen")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "Bijsterbosch")