- where.add((Constraint("uid", "uid", CharField()), 'exact', 1), AND)
- self.assertEquals(where.as_sql(), "(uid=1)")
+ where.add((Constraint("uid", "uid", IntegerField()), 'exact', 1), AND)
+ self.assertEquals(where_as_ldap(where), ("(uid=1)", []))
+
+ where = WhereNode()
+ where.add((Constraint("uid", "uid", IntegerField()), 'gte', 1), AND)
+ self.assertEquals(where_as_ldap(where), ("(uid>=1)", []))
+
+ where = WhereNode()
+ where.add((Constraint("uid", "uid", IntegerField()), 'lte', 1), AND)
+ self.assertEquals(where_as_ldap(where), ("(uid<=1)", []))
+
+ def test_list_field_contains(self):
+ where = WhereNode()
+ where.add((Constraint("memberUid", "memberUid", ListField()), 'contains', 'foouser'), AND)
+ self.assertEquals(where_as_ldap(where), ("(memberUid=foouser)", []))
+
+ where = WhereNode()
+ where.add((Constraint("memberUid", "memberUid", ListField()), 'contains', '(foouser)'), AND)
+ self.assertEquals(where_as_ldap(where), ("(memberUid=\\28foouser\\29)", []))