diff options
| author | Ants Aasma <ants.aasma@gmail.com> | 2007-06-26 16:37:30 +0000 |
|---|---|---|
| committer | Ants Aasma <ants.aasma@gmail.com> | 2007-06-26 16:37:30 +0000 |
| commit | b191254d8aceca10b40dd5957f3ddf9147a4c534 (patch) | |
| tree | 1362d1c2b224c1b3a102f5656236e61be18b320f /test/sql/query.py | |
| parent | 987581e6d2c893f4fe1c6877bd4b096f00ff63c3 (diff) | |
| download | sqlalchemy-b191254d8aceca10b40dd5957f3ddf9147a4c534.tar.gz | |
fix #624, modulo operator escaping on mysql and postgres
someone should test this with oracle, firebird and sql server also
Diffstat (limited to 'test/sql/query.py')
| -rw-r--r-- | test/sql/query.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/sql/query.py b/test/sql/query.py index 593b392e8..f7c38eb87 100644 --- a/test/sql/query.py +++ b/test/sql/query.py @@ -637,6 +637,30 @@ class CompoundTest(PersistTest): assert u.execute().fetchall() == [('aaa', 'bbb'), ('bbb', 'ccc'), ('ccc', 'aaa')] assert u.alias('foo').select().execute().fetchall() == [('aaa', 'bbb'), ('bbb', 'ccc'), ('ccc', 'aaa')] +class OperatorTest(PersistTest): + def setUpAll(self): + global metadata, flds + metadata = BoundMetaData(testbase.db) + flds = Table('flds', metadata, + Column('idcol', Integer, Sequence('t1pkseq'), primary_key=True), + Column('intcol', Integer), + Column('strcol', String(50)), + ) + metadata.create_all() + + flds.insert().execute([ + dict(intcol=5, strcol='foo'), + dict(intcol=13, strcol='bar') + ]) + + def tearDownAll(self): + metadata.drop_all() + + def test_modulo(self): + self.assertEquals( + select([flds.c.intcol % 3], order_by=flds.c.idcol).execute().fetchall(), + [(2,),(1,)] + ) if __name__ == "__main__": testbase.main() |
