From: jlaine Date: Mon, 31 May 2010 16:12:33 +0000 (+0000) Subject: improve unit tests X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=5940d76f9249693c27b6665f6687a172d374dcbb;p=matthijs%2Fupstream%2Fdjango-ldapdb.git improve unit tests git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@892 e071eeec-0327-468d-9b6a-08194a12b294 --- 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']