And how do you reference it from your test initializer? On Aug 4, 11:26 am, Brennan Todd <[email protected]> wrote: > On Wed, Aug 4, 2010 at 1:38 AM, Ryan <[email protected]> wrote: > > I followed this how-to (http://farmdev.com/projects/fixture/using- > > fixture-with-pylons.html) on using fixtures with Pylons, which was > > written for 0.9.7. In the `tests/__init__.py` file, an > > `SQLAlchemyFixture` object needs to be instantiated, which requires a > > reference to an SQLAlchemy engine. I'm sure this must be loaded > > somewhere in the environment, but the suggested `meta.engine` is not > > correct for 1.0 and I was not able to find it, so I went with this > > instead. > > > import sqlalchemy as sa > > engine = sa.create_engine('mysql://user:p...@localhost:3306/app_name') > > > dbfixture = SQLAlchemyFixture( > > env = model, > > engine = engine, > > style = NamedDataStyle()) > > > Ugly. Can anyone tell me the best way to reference the engine? Thanks. > > I ran into the same issue. What I did was just make sure the meta.engine is > set to the engine when model.init_model is called during setup.
-- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
