From: jlaine Date: Mon, 24 May 2010 08:30:38 +0000 (+0000) Subject: test 'in' operator X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=c691191aa52b340fd060957aeaf3d53594074a00;p=matthijs%2Fupstream%2Fdjango-ldapdb.git test 'in' operator git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@863 e071eeec-0327-468d-9b6a-08194a12b294 --- diff --git a/ldapdb/tests.py b/ldapdb/tests.py index de13b9d..10b7c5b 100644 --- a/ldapdb/tests.py +++ b/ldapdb/tests.py @@ -42,6 +42,14 @@ class WhereTestCase(TestCase): where.add((Constraint("cn", "cn", CharField()), 'exact', "(test)"), AND) self.assertEquals(where.as_sql(), "(cn=\\28test\\29)") + where = WhereNode() + where.add((Constraint("cn", "cn", CharField()), 'in', ["foo", "bar"]), AND) + self.assertEquals(where.as_sql(), "(|(cn=foo)(cn=bar))") + + where = WhereNode() + where.add((Constraint("cn", "cn", CharField()), 'in', ["(foo)", "(bar)"]), AND) + self.assertEquals(where.as_sql(), "(|(cn=\\28foo\\29)(cn=\\28bar\\29))") + where = WhereNode() where.add((Constraint("cn", "cn", CharField()), 'startswith', "test"), AND) self.assertEquals(where.as_sql(), "(cn=test*)")