def setUp(self): Base.metadata.create_all(bind=Session.bind) f = Foo(id=1, bar=u"Wabbit") Session.add(f) Session.commit() assert f.bar == u"Wabbit"
def testsqlalchemy(self): if SQLAtesting: c.foos = Session.query(Foo).all() return render_mako('test_sqlalchemy.html') pass
def setUp(self): Base.metadata.create_all(bind=Session.bind) f = Foo(id = 1, bar = u"Wabbit") Session.add(f) Session.commit() assert f.bar == u"Wabbit"
def init_model(engine): """Call me before using any of the tables or classes in the model""" Session.configure(bind=engine)