On Mar 5, 8:35 am, Patrick Lewis <[EMAIL PROTECTED]> wrote: > On Mar 5, 7:37 am, Cito <[EMAIL PROTECTED]> wrote: > > > The problem is the testutil.sqlalchemy_cleanup() in line 11. This > > should be only called in teardown_module(). I don't know why it > > yesterday seemed to work for me, since sqlalchemy_cleanup() clears all > > the mappers, metadata etc. so it cannot work. > > It also helps if I don't copy / paste directly from the pastebin. I > forgot to change the module names of my models and controllers to the > new testproject name. Once I fixed that, all tests passed. > > I don't think it has to do with that line. Yes, the cleanup gets rid > of everything, but then I import the model (which should do a > setup_all), and then the get_engine call to bind the metadata. I put > it there thinking that info left from the controller session may have > been messing stuff up. I don't know if that is an accurate assessment > or not. > > Anyways, I can get it to work in a test project. Now I guess I need to > see what is different about my real project. Thanks for your help.
For the record, here's what I ran into and my solution. I had moved my model into a folder named model, with each file generally having a different section of the model. The model folder had an __init__.py that looked something like: from elixir import setup_all from document import * from folder import * from page import * from identity import * setup_all() With this setup, I could never get nosetests to work. I usually got some exception as identity tried to set up its tables in the identity provider. But, making one change and moving 'from identity import *' to the top of the import list (instead of at the bottom), everything works. I don't really understand what's going on, and it kind of runs counter to how I thought setup_all works, but there it is. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

