From c691191aa52b340fd060957aeaf3d53594074a00 Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 24 May 2010 08:30:38 +0000 Subject: [PATCH] test 'in' operator git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@863 e071eeec-0327-468d-9b6a-08194a12b294 --- ldapdb/tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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*)") -- 2.30.2