forked from orbit-oss/flask
pass context through dispatch methods
This commit is contained in:
parent
adf363679d
commit
6a64969009
6 changed files with 167 additions and 72 deletions
|
|
@ -288,8 +288,9 @@ def test_bad_environ_raises_bad_request():
|
|||
# use a non-printable character in the Host - this is key to this test
|
||||
environ["HTTP_HOST"] = "\x8a"
|
||||
|
||||
with app.request_context(environ):
|
||||
response = app.full_dispatch_request()
|
||||
with app.request_context(environ) as ctx:
|
||||
response = app.full_dispatch_request(ctx)
|
||||
|
||||
assert response.status_code == 400
|
||||
|
||||
|
||||
|
|
@ -308,8 +309,8 @@ def test_environ_for_valid_idna_completes():
|
|||
# these characters are all IDNA-compatible
|
||||
environ["HTTP_HOST"] = "ąśźäüжŠßя.com"
|
||||
|
||||
with app.request_context(environ):
|
||||
response = app.full_dispatch_request()
|
||||
with app.request_context(environ) as ctx:
|
||||
response = app.full_dispatch_request(ctx)
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import flask
|
|||
|
||||
def test_suppressed_exception_logging():
|
||||
class SuppressedFlask(flask.Flask):
|
||||
def log_exception(self, exc_info):
|
||||
def log_exception(self, ctx, exc_info):
|
||||
pass
|
||||
|
||||
out = StringIO()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue