[ckan-dev] Help testing where new database tables are involved

David Raznick david.raznick at okfn.org
Thu Mar 21 21:22:13 UTC 2013


Hello

Are you testing with a sqlite database?  If so then there is a bug that the
session sometimes looses reference to it and I am not sure what causes it.
So I advise testing with postgres.

Thanks


On Thu, Mar 21, 2013 at 8:07 PM, Ryan Clark <ryan.clark at azgs.az.gov> wrote:

> 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
>
>
>
>
>
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130321/46751e48/attachment-0001.html>


More information about the ckan-dev mailing list