projects
/
matthijs
/
upstream
/
django-ldapdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update copyright date
[matthijs/upstream/django-ldapdb.git]
/
ldapdb
/
tests.py
diff --git
a/ldapdb/tests.py
b/ldapdb/tests.py
index e3f1410c2843cd4f1e4777a1518cae137d671a8b..4b6f7f15216ea28b36d1fee8165bc9421552c245 100644
(file)
--- a/
ldapdb/tests.py
+++ b/
ldapdb/tests.py
@@
-1,7
+1,7
@@
# -*- coding: utf-8 -*-
#
# django-ldapdb
# -*- coding: utf-8 -*-
#
# django-ldapdb
-# Copyright (C) 2009 Bolloré telecom
+# Copyright (C) 2009
-2010
Bolloré telecom
# See AUTHORS file for a full list of contributors.
#
# This program is free software: you can redistribute it and/or modify
# See AUTHORS file for a full list of contributors.
#
# This program is free software: you can redistribute it and/or modify
@@
-21,8
+21,9
@@
from django.test import TestCase
from django.db.models.sql.where import Constraint, AND, OR
from django.test import TestCase
from django.db.models.sql.where import Constraint, AND, OR
-from ldapdb.models.fields import CharField, IntegerField
-from ldapdb.models.query import WhereNode, escape_ldap_filter
+from ldapdb.models.query import escape_ldap_filter
+from ldapdb.models.fields import CharField, IntegerField, ListField
+from ldapdb.models.query import WhereNode
class WhereTestCase(TestCase):
def test_escape(self):
class WhereTestCase(TestCase):
def test_escape(self):
@@
-37,6
+38,10
@@
class WhereTestCase(TestCase):
where.add((Constraint("cn", "cn", CharField()), 'exact', "test"), AND)
self.assertEquals(where.as_sql(), "(cn=test)")
where.add((Constraint("cn", "cn", CharField()), 'exact', "test"), AND)
self.assertEquals(where.as_sql(), "(cn=test)")
+ where = WhereNode()
+ 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()), 'startswith', "test"), AND)
self.assertEquals(where.as_sql(), "(cn=test*)")
where = WhereNode()
where.add((Constraint("cn", "cn", CharField()), 'startswith', "test"), AND)
self.assertEquals(where.as_sql(), "(cn=test*)")
@@
-58,11
+63,6
@@
class WhereTestCase(TestCase):
where.add((Constraint("uid", "uid", CharField()), 'exact', 1), AND)
self.assertEquals(where.as_sql(), "(uid=1)")
where.add((Constraint("uid", "uid", CharField()), 'exact', 1), AND)
self.assertEquals(where.as_sql(), "(uid=1)")
- def test_escaped(self):
- where = WhereNode()
- where.add((Constraint("cn", "cn", CharField()), 'exact', "(test)"), AND)
- self.assertEquals(where.as_sql(), "(cn=\\28test\\29)")
-
def test_and(self):
where = WhereNode()
where.add((Constraint("cn", "cn", CharField()), 'exact', "foo"), AND)
def test_and(self):
where = WhereNode()
where.add((Constraint("cn", "cn", CharField()), 'exact', "foo"), AND)