def test_update(self):
g = LdapGroup.objects.get(name='foogroup')
+
+ g.gid = 1002
+ g.usernames = ['foouser2', 'baruser2']
+ g.save()
+
+ # make sure DN gets updated if we change the pk
g.name = 'foogroup2'
g.save()
-
- # make sure DN gets updated
self.assertEquals(g.dn, 'cn=foogroup2,ou=groups,dc=nodomain')
def test_delete(self):
self.assertRaises(LdapUser.DoesNotExist, LdapUser.objects.get, username='does_not_exist')
+ def test_update(self):
+ u = LdapUser.objects.get(username='foouser')
+ u.first_name = u'Fôo2'
+ u.save()
+
+ # make sure DN gets updated if we change the pk
+ u.username = 'foouser2'
+ u.save()
+ self.assertEquals(u.dn, 'uid=foouser2,ou=people,dc=nodomain')
+
class AdminTestCase(BaseTestCase):
fixtures = ['test_users.json']