Files
sqlalchemy/test/dialect/test_informix.py
T
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00

26 lines
1.0 KiB
Python

from sqlalchemy import *
from sqlalchemy.databases import informix
from sqlalchemy.testing import *
class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
__dialect__ = informix.InformixDialect()
def test_statements(self):
meta = MetaData()
t1 = Table('t1', meta, Column('col1', Integer,
primary_key=True), Column('col2', String(50)))
t2 = Table('t2', meta, Column('col1', Integer,
primary_key=True), Column('col2', String(50)),
Column('col3', Integer, ForeignKey('t1.col1')))
self.assert_compile(t1.select(),
'SELECT t1.col1, t1.col2 FROM t1')
self.assert_compile(select([t1, t2]).select_from(t1.join(t2)),
'SELECT t1.col1, t1.col2, t2.col1, '
't2.col2, t2.col3 FROM t1 JOIN t2 ON '
't1.col1 = t2.col3')
self.assert_compile(t1.update().values({t1.c.col1: t1.c.col1
+ 1}), 'UPDATE t1 SET col1=(t1.col1 + ?)')