Merge pull request #1222 from defuz/templates_auto_reload-eq-none
Set TEMPLATE_AUTO_RELOAD default value to None
This commit is contained in:
commit
a1b273658d
4 changed files with 39 additions and 15 deletions
|
|
@ -296,12 +296,36 @@ def test_iterable_loader():
|
|||
assert rv.data == b'<h1>Jameson</h1>'
|
||||
|
||||
def test_templates_auto_reload():
|
||||
# debug is False, config option is None
|
||||
app = flask.Flask(__name__)
|
||||
assert app.config['TEMPLATES_AUTO_RELOAD']
|
||||
assert app.jinja_env.auto_reload
|
||||
assert app.debug is False
|
||||
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.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):
|
||||
from blueprintapp import app
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue