summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorGaëtan de Menten <gdementen@gmail.com>2007-10-19 10:27:06 +0000
committerGaëtan de Menten <gdementen@gmail.com>2007-10-19 10:27:06 +0000
commitae553db3cdb71c3cc14ca02bf53d6a81ff99fb8a (patch)
treeb2b536c0b36a40b5d5ea65df62b61c6301f27e34 /test/sql
parent974f59f091d562bb0e141c6b4087160d16190c1c (diff)
downloadsqlalchemy-ae553db3cdb71c3cc14ca02bf53d6a81ff99fb8a.tar.gz
- Added contains operator (which generate a "LIKE %<other>%" clause).
- Added test coverage for endswith operator
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/select.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/sql/select.py b/test/sql/select.py
index 5c8b570d7..56bf1d92c 100644
--- a/test/sql/select.py
+++ b/test/sql/select.py
@@ -417,6 +417,18 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A
clause = (table1.c.myid == 12) & table1.c.myid.between(15, 20) & table1.c.myid.like('hoho')
assert str(clause) == str(util.pickle.loads(util.pickle.dumps(clause)))
+ def testextracomparisonoperators(self):
+ self.assert_compile(
+ table1.select(table1.c.name.contains('jo')),
+ "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.name LIKE :mytable_name",
+ checkparams = {'mytable_name': u'%jo%'},
+ )
+ self.assert_compile(
+ table1.select(table1.c.name.endswith('hn')),
+ "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.name LIKE :mytable_name",
+ checkparams = {'mytable_name': u'%hn'},
+ )
+
def testunicodestartswith(self):
string = u"hi \xf6 \xf5"
self.assert_compile(