예제 #1
0
 def test_get_uri(self):
     instance = NBASource()
     instance.full_name = "Henk van der Spek"
     instance.props = {}
     instance.save()
     uri = instance.get_uri()
     self.assertEqual(uri, "{}/admin/birthdays/nbasource/16/".format(settings.BIRTHDAYS_DOMAIN))
예제 #2
0
 def test_get_uri(self):
     instance = NBASource()
     instance.full_name = "Henk van der Spek"
     instance.props = {}
     instance.save()
     uri = instance.get_uri()
     self.assertEqual(uri, "{}/admin/birthdays/nbasource/12/".format(settings.BIRTHDAYS_DOMAIN))
예제 #3
0
 def test_nba_split_name(self):
     instance = NBASource()
     instance.full_name = "Spek, H. van der"
     instance.split_full_name()
     self.assertEqual(instance.initials, "H.")
     self.assertEqual(instance.prefix, "van der")
     self.assertEqual(instance.last_name, "van der Spek")
     instance = NBASource()
     instance.full_name = "Berkers, F.C."
     instance.split_full_name()
     self.assertEqual(instance.initials, "F.C.")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "Berkers")
     instance = NBASource()
     instance.full_name = "Berkers"
     instance.split_full_name()
     self.assertEqual(instance.initials, None)
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, None)
예제 #4
0
 def test_nba_split_name(self):
     instance = NBASource()
     instance.full_name = "Spek, H. van der"
     instance.split_full_name()
     self.assertEqual(instance.initials, "H.")
     self.assertEqual(instance.prefix, "van der")
     self.assertEqual(instance.last_name, "van der Spek")
     instance = NBASource()
     instance.full_name = "Berkers, F.C."
     instance.split_full_name()
     self.assertEqual(instance.initials, "F.C.")
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, "Berkers")
     instance = NBASource()
     instance.full_name = "Berkers"
     instance.split_full_name()
     self.assertEqual(instance.initials, None)
     self.assertEqual(instance.prefix, None)
     self.assertEqual(instance.last_name, None)