[sqlalchemy] flush() issued, SQL seen, but database not updated?

2010-12-26 Thread jerryji
Hi, I have been pulling my hair the whole day today: I have a web application that runs fine, however, during unittest I noticed that the test (PostgreSQL) database is not updated even after I issue the flush() and see the SQL statement, which inserts fine by itself in psql -- (Pdb) list 73

[sqlalchemy] Re: flush() issued, SQL seen, but database not updated?

2010-12-26 Thread jerryji
BTW, during testing, this _persistent_ user object dropped my jaw -- myapp/views/signup.py(73)signup_view() - user = model.User(user_name=user_name, email=email, password=password) (Pdb) n (Pdb) user pweb.models.User object at 0xbbb20ec (Pdb) user = None (Pdb) user pweb.models.User object at

[sqlalchemy] Re: flush() issued, SQL seen, but database not updated?

2010-12-26 Thread jerryji
Just to (partially) answer myself -- by enabling db logging, I see that the insertion is not seen in other db sessions because it gets rolled back, most likely done in unittest's setUp() and tearDown() -- though I still don't understand the persistent user object thing Jerry On Dec 26, 10:02 pm,

Re: [sqlalchemy] Re: flush() issued, SQL seen, but database not updated?

2010-12-26 Thread Michael Bayer
On Dec 26, 2010, at 9:02 AM, jerryji wrote: BTW, during testing, this _persistent_ user object dropped my jaw -- I think the user = None assignment has no effect in pdb since the existing contents of locals() is fixed. Otherwise the rollback behavior of your tests is why the PG database has

Re: [sqlalchemy] flush() issued, SQL seen, but database not updated?

2010-12-26 Thread Warwick Prince
Hi Jerry Looks to me like you will need to swap your .flush for a .commit.commit will flush for you, then actually commit the changes to the DB. :-) Cheers Warwick Hi, I have been pulling my hair the whole day today: I have a web application that runs fine, however, during unittest I

[sqlalchemy] SQLAlchemy NoSuchTableError

2010-12-26 Thread webjunkie
Im dveloping an app with Pylons and using sqlalchemy reflection on a postgres db. It all seems to work so far, but when I run tests using nose I get the following error Traceback (most recent call last): File /home/webjunkie/www/env/bin/nosetests, line 8, in module