Another valid option is to consider using bootalchemy. I was able to use it to load up a complete database model, and then run tests against that model. I modeled even many-to-many relations using it, and it was pretty straightforward. I'm actually planning on using it at work in the very near future again for a significant rewrite that I've got coming up.
On Wed, Nov 7, 2012 at 4:34 AM, Craig Small <[email protected]> wrote: > On Mon, Nov 05, 2012 at 12:55:22AM -0800, jeetu wrote: > > klass and attrs for testing a single table. What if i have multiple > tables > > like in many to one relationships. I want to initiate two tables in > single > > setup of nosetest. How to do it. I am expecting something like > I'm not sure myself. I've got the following. > > class TestParent(ModelTest): > klass = model.Parent > attrs = dict( > child = model.Child(u'Test Child Name') > ) > > or, just to be confusing: > > class TestParent(ModelTest): > klass = model.Parent > > def do_get_dependencies(self): > test_child = model.Child(u'Test Child Name') > return {'child': test_child } > > I think the second one is more correct but not sure. > > -- > Craig Small VK2XLZ http://enc.com.au/ csmall at : enc.com.au > Debian GNU/Linux http://www.debian.org/ csmall at : debian.org > GPG fingerprint: 5D2F B320 B825 D939 04D2 0519 3938 F96B DF50 FEA5 > > -- > You received this message because you are subscribed to the Google Groups > "TurboGears" 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/turbogears?hl=en. > > -- Michael J. Pedersen My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen Google Talk: [email protected] -- Twitter: pedersentg -- You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en.

