Browse Source

Added another testcase

pull/112/head
Armin Ronacher 15 years ago
parent
commit
9a21c34bb6
  1. 11
      tests/flask_tests.py

11
tests/flask_tests.py

@ -248,7 +248,13 @@ class BasicFunctionalityTestCase(unittest.TestCase):
flask.session['test'] = 42
flask.session.permanent = permanent
return ''
rv = app.test_client().get('/')
@app.route('/test')
def test():
return unicode(flask.session.permanent)
client = app.test_client()
rv = client.get('/')
assert 'set-cookie' in rv.headers
match = re.search(r'\bexpires=([^;]+)', rv.headers['set-cookie'])
expires = parse_date(match.group())
@ -257,6 +263,9 @@ class BasicFunctionalityTestCase(unittest.TestCase):
assert expires.month == expected.month
assert expires.day == expected.day
rv = client.get('/test')
assert rv.data == 'True'
permanent = False
rv = app.test_client().get('/')
assert 'set-cookie' in rv.headers

Loading…
Cancel
Save