forked from orbit-oss/flask
fix endline in the signal.py
This commit is contained in:
parent
d53d5c732b
commit
1fbeb337c4
2 changed files with 3 additions and 5 deletions
|
|
@ -53,4 +53,4 @@ got_request_exception = _signals.signal('got-request-exception')
|
||||||
appcontext_tearing_down = _signals.signal('appcontext-tearing-down')
|
appcontext_tearing_down = _signals.signal('appcontext-tearing-down')
|
||||||
appcontext_pushed = _signals.signal('appcontext-pushed')
|
appcontext_pushed = _signals.signal('appcontext-pushed')
|
||||||
appcontext_popped = _signals.signal('appcontext-popped')
|
appcontext_popped = _signals.signal('appcontext-popped')
|
||||||
message_flashed = _signals.signal('message-flashed')
|
message_flashed = _signals.signal('message-flashed')
|
||||||
|
|
|
||||||
|
|
@ -59,16 +59,14 @@ def test_before_render_template():
|
||||||
context['whiskey'] = 43
|
context['whiskey'] = 43
|
||||||
recorded.append((template, context))
|
recorded.append((template, context))
|
||||||
|
|
||||||
flask.before_render_template.connect(record, app)
|
with flask.before_render_template.connected_to(record):
|
||||||
try:
|
|
||||||
rv = app.test_client().get('/')
|
rv = app.test_client().get('/')
|
||||||
assert len(recorded) == 1
|
assert len(recorded) == 1
|
||||||
template, context = recorded[0]
|
template, context = recorded[0]
|
||||||
assert template.name == 'simple_template.html'
|
assert template.name == 'simple_template.html'
|
||||||
assert context['whiskey'] == 43
|
assert context['whiskey'] == 43
|
||||||
assert rv.data == b'<h1>43</h1>'
|
assert rv.data == b'<h1>43</h1>'
|
||||||
finally:
|
|
||||||
flask.before_render_template.disconnect(record, app)
|
|
||||||
|
|
||||||
def test_request_signals():
|
def test_request_signals():
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue