[ckan-dev] Help testing where new database tables are involved
Ryan Clark
ryan.clark at azgs.az.gov
Thu Mar 21 20:07:02 UTC 2013
Hi!
I'm having trouble with the testing environment.
I have a plugin that implements IConfigurable. How come the configure() method gets hit three times before my unittest.TestCase.setUp() is called? My plugin adds tables to the database so if I watch ckan.model.meta.tables.get("my_table").exists() each time I hit the configure() method....
First time is an error, NoneType has no method exists() -- expected, because the configure() code goes on to define the tables
Second time returns True -- the Table is defined in memory and the database. Expected since the last time it was hit should've created these things
Third time returns False -- the Table is still defined in memory but is not defined in the database any more.
Why is my table removed?
I run the tests via nosetest --ckan --with-pylons=my/ini/file.ini
Thanks!
____________________
Ryan Clark
Arizona Geological Survey
ryan.clark at azgs.az.gov
(520) 302-4871
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130321/09cad503/attachment.html>
More information about the ckan-dev
mailing list