[ckan-dev] RuntimeError on tests with latest master + New documentation for Flask migration issues
Adrià Mercader
adria.mercader at okfn.org
Thu Aug 31 12:11:04 UTC 2017
Hi list,
Just a quick note to say that we have reverted the original change that
required the test request context in tests, so no changes should be
required in new and existing tests.
Full details can be found here: https://github.com/ckan/ckan/pull/3782
If someone does bump into a RuntimeError please do let us know, as I might
have left out a corner case.
Best,
Adrià
On 27 July 2017 at 12:30, Adrià Mercader <adria.mercader at okfn.org> wrote:
> Hi all,
>
> Just a quick heads up if you are working against latest master on core
> or from an extension. When running tests that involve `url_for`
> directly or indirectly you might get the following exception:
>
> > RuntimeError: Attempted to generate a URL without the application
> context being pushed. This has to be executed when application context is
> available.
>
>
> This is caused by the way the new Flask based router has been
> integrated in our own `url_for` helper. This article in the
> documentation gives all necessary context and details on how to fix
> it:
>
> http://docs.ckan.org/en/latest/extensions/flask-
> migration.html#wrap-url-for-calls-in-tests-with-a-test-
> request-context-runtimeerror
>
>
> More generally, this documentation page will be the place where we
> will collect information on upgrades needed for the Flask migration
> (which we are hoping to minimize). From the docs:
>
> > This page lists changes and deprecations that both core and extensions
> developers should be aware of going forward, as well as common exceptions
> and how to fix them.
>
>
> Best,
>
> Adrià
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20170831/813b4381/attachment-0002.html>
More information about the ckan-dev
mailing list