X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fdjango-ldapdb.git;a=blobdiff_plain;f=examples%2Ftests.py;h=bca180294e5a8f038a176561aaac6886df88e2d5;hp=9755752da3c04cf384a812630e6ad04169266e52;hb=5940d76f9249693c27b6665f6687a172d374dcbb;hpb=adf0e789122e9362c67921492500edf844876219 diff --git a/examples/tests.py b/examples/tests.py index 9755752..bca1802 100644 --- a/examples/tests.py +++ b/examples/tests.py @@ -83,10 +83,14 @@ class GroupTestCase(BaseTestCase): 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): @@ -126,6 +130,16 @@ class UserTestCase(BaseTestCase): 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']