librelist archives

« back to archive

How do you set up fixtures in flask?

How do you set up fixtures in flask?

From:
Nicholas Retallack
Date:
2011-02-12 @ 21:48
This snippet on testing <http://flask.pocoo.org/snippets/26/> mentions you
could use FIxture to test sqlalchemy models.  But the Fixture tutorial seems
very specific to Pylons.  If anyone has this working with Flask, could you
share how you did it?

Re: [flask] How do you set up fixtures in flask?

From:
Ron DuPlain
Date:
2011-02-13 @ 05:26
Hi Nicholas,

On Sat, Feb 12, 2011 at 4:48 PM, Nicholas Retallack
<nickretallack@gmail.com> wrote:
> This snippet on testing mentions you could use FIxture to test sqlalchemy
> models.  But the Fixture tutorial seems very specific to Pylons.  If anyone
> has this working with Flask, could you share how you did it?

https://gist.github.com/824472

Hope this helps,

Ron

Re: [flask] How do you set up fixtures in flask?

From:
Nicholas Retallack
Date:
2011-02-16 @ 10:21
It took me a while to figure out how this works.  It seems odd that it does
a db.dispose() on the fixtures object in the install function -- this does
not work in my setup, so I moved it to the teardown phase.

Now that I have fixtures working, how do I get the actual database record
associated with one of my fixture DataSets?  Like, what if I wanted to know
what id my fixture was created with?  Should I specify that myself?

On Sat, Feb 12, 2011 at 9:26 PM, Ron DuPlain <ron.duplain@gmail.com> wrote:

> Hi Nicholas,
>
> On Sat, Feb 12, 2011 at 4:48 PM, Nicholas Retallack
> <nickretallack@gmail.com> wrote:
> > This snippet on testing mentions you could use FIxture to test sqlalchemy
> > models.  But the Fixture tutorial seems very specific to Pylons.  If
> anyone
> > has this working with Flask, could you share how you did it?
>
> https://gist.github.com/824472
>
> Hope this helps,
>
> Ron
>