From 5581ef499d94127504e076f540e71ef412fd88df Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 31 May 2010 19:56:59 +0000 Subject: [PATCH] add more groups for tests git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@912 e071eeec-0327-468d-9b6a-08194a12b294 --- examples/tests.py | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/examples/tests.py b/examples/tests.py index 26d07d3..e96ad90 100644 --- a/examples/tests.py +++ b/examples/tests.py @@ -62,12 +62,18 @@ class GroupTestCase(BaseTestCase): g.usernames = ['zoouser', 'baruser'] g.save() + g = LdapGroup() + g.name = "wizgroup" + g.gid = 1002 + g.usernames = ['wizuser', 'baruser'] + g.save() + def test_filter(self): qs = LdapGroup.objects.none() self.assertEquals(len(qs), 0) qs = LdapGroup.objects.all() - self.assertEquals(len(qs), 2) + self.assertEquals(len(qs), 3) qs = LdapGroup.objects.filter(name='foogroup') self.assertEquals(len(qs), 1) @@ -95,27 +101,31 @@ class GroupTestCase(BaseTestCase): def test_order_by(self): # ascending name qs = LdapGroup.objects.order_by('name') - self.assertEquals(len(qs), 2) + self.assertEquals(len(qs), 3) self.assertEquals(qs[0].name, 'bargroup') self.assertEquals(qs[1].name, 'foogroup') + self.assertEquals(qs[2].name, 'wizgroup') # descending name qs = LdapGroup.objects.order_by('-name') - self.assertEquals(len(qs), 2) - self.assertEquals(qs[0].name, 'foogroup') - self.assertEquals(qs[1].name, 'bargroup') + self.assertEquals(len(qs), 3) + self.assertEquals(qs[0].name, 'wizgroup') + self.assertEquals(qs[1].name, 'foogroup') + self.assertEquals(qs[2].name, 'bargroup') # ascending gid qs = LdapGroup.objects.order_by('gid') - self.assertEquals(len(qs), 2) + self.assertEquals(len(qs), 3) self.assertEquals(qs[0].gid, 1000) self.assertEquals(qs[1].gid, 1001) + self.assertEquals(qs[2].gid, 1002) # descending gid qs = LdapGroup.objects.order_by('-gid') - self.assertEquals(len(qs), 2) - self.assertEquals(qs[0].gid, 1001) - self.assertEquals(qs[1].gid, 1000) + self.assertEquals(len(qs), 3) + self.assertEquals(qs[0].gid, 1002) + self.assertEquals(qs[1].gid, 1001) + self.assertEquals(qs[2].gid, 1000) def test_bulk_delete(self): LdapGroup.objects.all().delete() @@ -140,7 +150,7 @@ class GroupTestCase(BaseTestCase): g.delete() qs = LdapGroup.objects.all() - self.assertEquals(len(qs), 1) + self.assertEquals(len(qs), 2) class UserTestCase(BaseTestCase): def setUp(self): -- 2.30.2