X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=ldapdb%2Ftests.py;h=e3c787b008d3db8a7100a73f88943670cbd11cbf;hb=5b97fccb66efc67de3ce0165528cd454b2245ddc;hp=806c764b95dd56a6fe545ba1dfeb33261a993d36;hpb=85099b38b796976f9a9f3a86f094e37548fd47f8;p=matthijs%2Fupstream%2Fdjango-ldapdb.git diff --git a/ldapdb/tests.py b/ldapdb/tests.py index 806c764..e3c787b 100644 --- a/ldapdb/tests.py +++ b/ldapdb/tests.py @@ -21,8 +21,13 @@ from django.test import TestCase from django.db.models.sql.where import Constraint, AND, OR +from ldapdb.models.fields import CharField from ldapdb.models.query import WhereNode +class FieldTestCase(TestCase): + def test_db_prep(self): + field = CharField() + class WhereTestCase(TestCase): def test_single(self): where = WhereNode() @@ -37,6 +42,10 @@ class WhereTestCase(TestCase): where.add((Constraint("cn", "cn", None), 'endswith', "test"), AND) self.assertEquals(where.as_sql(), "(cn=*test)") + where = WhereNode() + where.add((Constraint("cn", "cn", None), 'in', ["foo", "bar"]), AND) + self.assertEquals(where.as_sql(), "(|(cn=foo)(cn=bar))") + def test_and(self): where = WhereNode() where.add((Constraint("cn", "cn", None), 'exact', "foo"), AND)