Skip to content
Myr

Added another testcase

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

authored by Armin Ronacher · committed by Armin Ronacher · parent a3a8439 · Browse files · 1 file+10 added−1 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+10 added−1 removed

  • tests:+10 added−1 removed

1 file+10 added−1 removed

modified:tests/flask_tests.py+10 added-1 removed
246 unmodified lines
247 def index():248 flask.session['test'] = 42249 flask.session.permanent = permanent250 return ''251 rv = app.test_client().get('/')251252 @app.route('/test')253 def test():254 return unicode(flask.session.permanent)255256 client = app.test_client()257 rv = client.get('/')258 assert 'set-cookie' in rv.headers259 match = re.search(r'\bexpires=([^;]+)', rv.headers['set-cookie'])260 expires = parse_date(match.group())261 expected = datetime.utcnow() + app.permanent_session_lifetime262 assert expires.year == expected.year263 assert expires.month == expected.month264 assert expires.day == expected.day265266 rv = client.get('/test')267 assert rv.data == 'True'268269 permanent = False270 rv = app.test_client().get('/')271 assert 'set-cookie' in rv.headers272 match = re.search(r'\bexpires=([^;]+)', rv.headers['set-cookie'])
971 unmodified lines