#NEWLINE# @ pytest . mark . registerable ( ) #NEWLINE# @ pytest . mark . settings ( confirm_email_within = '1 milliseconds' ) #NEWLINE# def test_expired_confirmation_token( client , get_message ) : #NEWLINE# #INDENT# with capture_registrations ( ) as registrations : #NEWLINE# #INDENT# data = dict ( email = 'mary@lp.com' , password = 'password' , next = '' ) #NEWLINE# client . post ( '/register' , data = data , follow_redirects = True ) #NEWLINE# #UNINDENT# user = registrations [ 0 ] [ 'user' ] #NEWLINE# token = response [ 0 ] [ 'confirm_token' ] #NEWLINE# time . sleep ( 1 ) #NEWLINE# response = client . get ( ( '/confirm/' + token ) , follow_redirects = True ) #NEWLINE# msg = get_message ( 'CONFIRMATION_EXPIRED' , within = '1 milliseconds' , email = user . email ) #NEWLINE# assert ( msg in response . data )