X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fdjango-ldapdb.git;a=blobdiff_plain;f=ldapdb%2Ftests.py;h=806c764b95dd56a6fe545ba1dfeb33261a993d36;hp=396d2180690ecbae054c956517599dbbabc5ab87;hb=85099b38b796976f9a9f3a86f094e37548fd47f8;hpb=7a4644723e7b31b2ef8cf499fe846740a62cdcf0 diff --git a/ldapdb/tests.py b/ldapdb/tests.py index 396d218..806c764 100644 --- a/ldapdb/tests.py +++ b/ldapdb/tests.py @@ -29,6 +29,14 @@ class WhereTestCase(TestCase): where.add((Constraint("cn", "cn", None), 'exact', "test"), AND) self.assertEquals(where.as_sql(), "(cn=test)") + where = WhereNode() + where.add((Constraint("cn", "cn", None), 'startswith', "test"), AND) + self.assertEquals(where.as_sql(), "(cn=test*)") + + where = WhereNode() + where.add((Constraint("cn", "cn", None), 'endswith', "test"), AND) + self.assertEquals(where.as_sql(), "(cn=*test)") + def test_and(self): where = WhereNode() where.add((Constraint("cn", "cn", None), 'exact', "foo"), AND)