diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-19 20:25:51 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2008-03-19 20:25:51 +0000 |
| commit | 8d0c5672f06952382b4eedf78158a043b3529878 (patch) | |
| tree | 39af04ae51edbe52cc73141de30febb028628c25 /test/sql/select.py | |
| parent | 0cc04e6e1b70abc4817f275a898aa063da3de007 (diff) | |
| download | sqlalchemy-8d0c5672f06952382b4eedf78158a043b3529878.tar.gz | |
added escape kw arg to contains(), startswith(), endswith(), [ticket:791]
Diffstat (limited to 'test/sql/select.py')
| -rw-r--r-- | test/sql/select.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/sql/select.py b/test/sql/select.py index 21b246d26..24cff7702 100644 --- a/test/sql/select.py +++ b/test/sql/select.py @@ -456,8 +456,11 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A dialect=mysql.dialect() ) self.assert_compile( - table1.c.name.endswith('hn'), "mytable.name LIKE '%%' || :mytable_name_1", checkparams = {'mytable_name_1': u'hn'}, + table1.c.name.contains('jo', escape='\\'), "mytable.name LIKE '%%' || :mytable_name_1 || '%%' ESCAPE '\\'" , checkparams = {'mytable_name_1': u'jo'}, ) + self.assert_compile( table1.c.name.startswith('jo', escape='\\'), "mytable.name LIKE :mytable_name_1 || '%%' ESCAPE '\\'" ) + self.assert_compile( table1.c.name.endswith('jo', escape='\\'), "mytable.name LIKE '%%' || :mytable_name_1 ESCAPE '\\'" ) + self.assert_compile( table1.c.name.endswith('hn'), "mytable.name LIKE '%%' || :mytable_name_1", checkparams = {'mytable_name_1': u'hn'}, ) self.assert_compile( table1.c.name.endswith('hn'), "mytable.name LIKE concat('%%', %s)", checkparams = {'mytable_name_1': u'hn'}, dialect=mysql.dialect() |
