Ejemplo n.º 1
0
 def test_long_surname_is_truncated(self):
     too_long_surname = 'this-is-to-long-surname-so-it-should-be-truncated'
     ldap_dict = {'sn': [too_long_surname]}
     default_django_surname_length = 30
     _truncate_surname(ldap_dict)
     self.assertEqual(ldap_dict['sn'],
                      [too_long_surname[:default_django_surname_length]])
Ejemplo n.º 2
0
 def test_long_surname_is_truncated(self):
     too_long_surname = 'this-is-to-long-surname-so-it-should-be-truncated'
     ldap_dict = {'sn': [too_long_surname]}
     default_django_surname_length = 30
     _truncate_surname(ldap_dict)
     self.assertEqual(
         ldap_dict['sn'],
         [too_long_surname[:default_django_surname_length]]
     )
Ejemplo n.º 3
0
 def test_truncate_works_when_no_sn(self):
     ldap_dict = {}
     _truncate_surname(ldap_dict)
Ejemplo n.º 4
0
 def test_short_surname_stays_unmodified(self):
     short_surname = 'short-surname'
     ldap_dict = {'sn': [short_surname]}
     _truncate_surname(ldap_dict)
     self.assertEqual(ldap_dict['sn'], [short_surname])
Ejemplo n.º 5
0
 def test_truncate_works_when_no_sn(self):
     ldap_dict = {}
     _truncate_surname(ldap_dict)
Ejemplo n.º 6
0
 def test_short_surname_stays_unmodified(self):
     short_surname = 'short-surname'
     ldap_dict = {'sn': [short_surname]}
     _truncate_surname(ldap_dict)
     self.assertEqual(ldap_dict['sn'], [short_surname])