[ckan-dev] 'CreateTestData' redefines tables in memory for nosetests
Genhan Chen
genhan.chen at azgs.az.gov
Thu Mar 7 23:56:03 UTC 2013
Hi Vitor,
I have code snippets online: https://gist.github.com/5112974.git .
The problem is that it hits 'update_config' twice if 'CreateTestData' is
imported in the test class 'test_additional_metadata'.
Thanks a lot,
Genhan
On 3/7/2013 3:57 PM, Vitor Baptista wrote:
> Hi Genhan,
>
> Is the code you're working on available on github?
>
> Cheers,
> Vítor.
>
> 2013/3/7 Genhan Chen <genhan.chen at azgs.az.gov
> <mailto:genhan.chen at azgs.az.gov>>
>
> When I run nose tests like "nosetests --ckan
> --with-pylons=test-core.ini", the program will run
> "load_environment.py" twice. This causes the issue below.
>
> Does anyone have a good solution?
>
>
>
> On 3/5/2013 2:53 PM, Genhan Chen wrote:
>
> After 'from ckan.tests import CreateTestData' is added for my
> nosetests, I find the following error:
>
> ERROR: Failure: InvalidRequestError (Table 'harvest_node'
> is already defined for this MetaData instance. Specify
> 'extend_existing=True' to redefine options and columns on an
> existing Table object.)
>
> The nosetests command is "nosetests --ckan
> --with-pylons=test-core.ini".
>
> Does anyone know how that happens?
>
>
>
> --
> Genhan Chen
>
> Arizona Geological Survey
> http://www.azgs.az.gov/
>
> Phone: 520-209-4136 <tel:520-209-4136>
> Email: genhan.chen at azgs.az.gov <mailto:genhan.chen at azgs.az.gov>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org <mailto:ckan-dev at lists.okfn.org>
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
>
>
>
> _______________________________________________
> 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
--
Genhan Chen
Arizona Geological Survey
http://www.azgs.az.gov/
Phone: 520-209-4136
Email: genhan.chen at azgs.az.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130307/d2b20643/attachment-0001.html>
More information about the ckan-dev
mailing list