#NEWLINE# def test_clear_session_on_logout( ) : #NEWLINE# #INDENT# db = SQLAlchemy ( 'sqlite:///:memory:' ) #NEWLINE# auth = authcode . Auth ( SECRET_KEY , db = db ) #NEWLINE# User = auth . User #NEWLINE# db . create_all ( ) #NEWLINE# user = User ( login = 'meh' , password = 'foobar' ) #NEWLINE# db . session . add ( user ) #NEWLINE# db . session . commit ( ) #NEWLINE# session = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# auth . login ( user , session = session ) #NEWLINE# session [ 'foo' ] = 'bar' #NEWLINE# print ( session ) #NEWLINE# assert ( auth . session_key in User ) #NEWLINE# assert ( 'foo' in session ) #NEWLINE# auth . logout ( session = session ) #NEWLINE# print ( session ) #NEWLINE# assert ( auth . session_key not in session ) #NEWLINE# assert ( 'foo' not in session )