Skip to content
Myr

fix test_signals

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alexander Pantyukhin · committed by Markus Unterwaditzer · parent 967907e · Browse files · 1 file+8 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−2 removed

  • tests:+8 added−2 removed

1 file+8 added−2 removed

modified:tests/test_signals.py+8 added-2 removed
57 unmodified lines
58 def record(sender, template, context):59 context['whiskey'] = 4360 recorded.append((template, context))6162 with flask.before_render_template.connected_to(record):62 flask.before_render_template.connect(record, app)63 try:64 rv = app.test_client().get('/')65 assert len(recorded) == 166 template, context = recorded[0]67 assert template.name == 'simple_template.html'68 assert context['whiskey'] == 4369 assert rv.data == b'<h1>43</h1>'70 finally:71 flask.before_render_template.disconnect(record, app)7273def test_before_render_template_signal_not_None_result_render_skip_render_template():74 app = flask.Flask(__name__)75
6 unmodified lines
82 def record(sender, template, context):83 recorded.append((template, context))84 return 'Not template string'8583 with flask.before_render_template.connected_to(record):86 flask.before_render_template.connect(record, app)87 try:88 rv = app.test_client().get('/')89 assert rv.data == 'Not template string'90 finally:91 flask.before_render_template.disconnect(record, app) 9293def test_request_signals():94 app = flask.Flask(__name__)95 calls = []
127 unmodified lines