support timedelta for SEND_FILE_MAX_AGE_DEFAULT config variable

This commit is contained in:
Timo Furrer 2015-10-24 07:04:23 +02:00
parent 1ac4156016
commit d526932a09
5 changed files with 36 additions and 7 deletions

View file

@ -10,6 +10,7 @@
import pytest
import os
from datetime import timedelta
import flask
@ -168,6 +169,14 @@ def test_session_lifetime():
assert app.permanent_session_lifetime.seconds == 42
def test_send_file_max_age():
app = flask.Flask(__name__)
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 3600
assert app.send_file_max_age_default.seconds == 3600
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = timedelta(hours=2)
assert app.send_file_max_age_default.seconds == 7200
def test_get_namespace():
app = flask.Flask(__name__)
app.config['FOO_OPTION_1'] = 'foo option 1'