projects
/
matthijs
/
upstream
/
django-ldapdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
catch ldap.NO_SUCH_OBJECT for calls to ldap.search_s
[matthijs/upstream/django-ldapdb.git]
/
examples
/
tests.py
diff --git
a/examples/tests.py
b/examples/tests.py
index 465c857a50fcb18d9cfdff8e7a28d7f928bb372d..26d07d3ee1649282f4d82d02022dd103b5defd67 100644
(file)
--- a/
examples/tests.py
+++ b/
examples/tests.py
@@
-78,7
+78,7
@@
class GroupTestCase(BaseTestCase):
self.assertEquals(g.gid, 1000)
self.assertEquals(g.usernames, ['foouser', 'baruser'])
self.assertEquals(g.gid, 1000)
self.assertEquals(g.usernames, ['foouser', 'baruser'])
- # try to
get non-existent entry
+ # try to
filter non-existent entries
qs = LdapGroup.objects.filter(name='does_not_exist')
self.assertEquals(len(qs), 0)
qs = LdapGroup.objects.filter(name='does_not_exist')
self.assertEquals(len(qs), 0)
@@
-89,6
+89,7
@@
class GroupTestCase(BaseTestCase):
self.assertEquals(g.gid, 1000)
self.assertEquals(g.usernames, ['foouser', 'baruser'])
self.assertEquals(g.gid, 1000)
self.assertEquals(g.usernames, ['foouser', 'baruser'])
+ # try to get a non-existent entry
self.assertRaises(LdapGroup.DoesNotExist, LdapGroup.objects.get, name='does_not_exist')
def test_order_by(self):
self.assertRaises(LdapGroup.DoesNotExist, LdapGroup.objects.get, name='does_not_exist')
def test_order_by(self):
@@
-116,6
+117,12
@@
class GroupTestCase(BaseTestCase):
self.assertEquals(qs[0].gid, 1001)
self.assertEquals(qs[1].gid, 1000)
self.assertEquals(qs[0].gid, 1001)
self.assertEquals(qs[1].gid, 1000)
+ def test_bulk_delete(self):
+ LdapGroup.objects.all().delete()
+
+ qs = LdapGroup.objects.all()
+ self.assertEquals(len(qs), 0)
+
def test_update(self):
g = LdapGroup.objects.get(name='foogroup')
def test_update(self):
g = LdapGroup.objects.get(name='foogroup')