|
|
@ -296,12 +296,36 @@ def test_iterable_loader(): |
|
|
|
assert rv.data == b'<h1>Jameson</h1>' |
|
|
|
assert rv.data == b'<h1>Jameson</h1>' |
|
|
|
|
|
|
|
|
|
|
|
def test_templates_auto_reload(): |
|
|
|
def test_templates_auto_reload(): |
|
|
|
|
|
|
|
# debug is False, config option is None |
|
|
|
app = flask.Flask(__name__) |
|
|
|
app = flask.Flask(__name__) |
|
|
|
assert app.config['TEMPLATES_AUTO_RELOAD'] |
|
|
|
assert app.debug is False |
|
|
|
assert app.jinja_env.auto_reload |
|
|
|
assert app.config['TEMPLATES_AUTO_RELOAD'] is None |
|
|
|
|
|
|
|
assert app.jinja_env.auto_reload is False |
|
|
|
|
|
|
|
# debug is False, config option is False |
|
|
|
app = flask.Flask(__name__) |
|
|
|
app = flask.Flask(__name__) |
|
|
|
app.config['TEMPLATES_AUTO_RELOAD'] = False |
|
|
|
app.config['TEMPLATES_AUTO_RELOAD'] = False |
|
|
|
assert not app.jinja_env.auto_reload |
|
|
|
assert app.debug is False |
|
|
|
|
|
|
|
assert app.jinja_env.auto_reload is False |
|
|
|
|
|
|
|
# debug is False, config option is True |
|
|
|
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
|
|
|
|
app.config['TEMPLATES_AUTO_RELOAD'] = True |
|
|
|
|
|
|
|
assert app.debug is False |
|
|
|
|
|
|
|
assert app.jinja_env.auto_reload is True |
|
|
|
|
|
|
|
# debug is True, config option is None |
|
|
|
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
|
|
|
|
app.config['DEBUG'] = True |
|
|
|
|
|
|
|
assert app.config['TEMPLATES_AUTO_RELOAD'] is None |
|
|
|
|
|
|
|
assert app.jinja_env.auto_reload is True |
|
|
|
|
|
|
|
# debug is True, config option is False |
|
|
|
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
|
|
|
|
app.config['DEBUG'] = True |
|
|
|
|
|
|
|
app.config['TEMPLATES_AUTO_RELOAD'] = False |
|
|
|
|
|
|
|
assert app.jinja_env.auto_reload is False |
|
|
|
|
|
|
|
# debug is True, config option is True |
|
|
|
|
|
|
|
app = flask.Flask(__name__) |
|
|
|
|
|
|
|
app.config['DEBUG'] = True |
|
|
|
|
|
|
|
app.config['TEMPLATES_AUTO_RELOAD'] = True |
|
|
|
|
|
|
|
assert app.jinja_env.auto_reload is True |
|
|
|
|
|
|
|
|
|
|
|
def test_template_loader_debugging(test_apps): |
|
|
|
def test_template_loader_debugging(test_apps): |
|
|
|
from blueprintapp import app |
|
|
|
from blueprintapp import app |
|
|
|