Move object_hook outside loads method so class can be extend and reused

This commit is contained in:
Josh Rowe 2017-02-23 15:23:44 +00:00
parent dc5f48f587
commit 8a8a608152
2 changed files with 108 additions and 43 deletions

View file

@ -383,6 +383,9 @@ def test_session_special_types():
flask.session['dt'] = now
flask.session['b'] = b'\xff'
flask.session['t'] = (1, 2, 3)
flask.session['spacefirst'] = {' t': 'not-a-tuple'}
flask.session['withunderscores'] = {' t__': 'not-a-tuple'}
flask.session['notadict'] = {' di': 'not-a-dict'}
return response
@app.route('/')
@ -399,6 +402,9 @@ def test_session_special_types():
assert rv['b'] == b'\xff'
assert type(rv['b']) == bytes
assert rv['t'] == (1, 2, 3)
assert rv['spacefirst'] == {' t': 'not-a-tuple'}
assert rv['withunderscores'] == {' t__': 'not-a-tuple'}
assert rv['notadict'] == {' di': 'not-a-dict'}
def test_session_cookie_setting():