wait until app ctx is ready before matching url

`RequestContext.match_request` is moved from `__init__` to `push`. This
causes matching to happen later, when the app context is available.
This enables URL converters that use things such as the database.
This commit is contained in:
Elad Moshe 2019-02-24 23:54:57 +02:00 committed by David Lord
parent 29111a3259
commit 1ff98a2d21
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
4 changed files with 41 additions and 24 deletions

View file

@ -153,7 +153,6 @@ def test_blueprint_with_subdomain():
ctx = app.test_request_context("/", subdomain="xxx")
assert ctx.request.url == "http://xxx.example.com:1234/foo/"
assert ctx.request.blueprint == bp.name
rv = client.get("/", subdomain="xxx")
assert rv.data == b"http://xxx.example.com:1234/foo/"