test 'in' operator
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 24 May 2010 08:30:38 +0000 (08:30 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Mon, 24 May 2010 08:30:38 +0000 (08:30 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@863 e071eeec-0327-468d-9b6a-08194a12b294

ldapdb/tests.py

index de13b9d97303357a4583617475cafd04d9e8cd21..10b7c5bd347f02db01691a0789ce7e557b8987cb 100644 (file)
@@ -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*)")