#NEWLINE# @ mock . patch . object ( Token , 'get' , mock . Mock ( return_value = TokenDB ( id = OBJ_ID , user = USER , token = TOKEN , expiry = PAST ) ) ) #NEWLINE# def test_token_expired( self ) : #NEWLINE# #INDENT# response = self . app . get ( '/v1/actions' , headers = { #NEWLINE# #INDENT# 'X-Auth-Token' : TOKEN , #NEWLINE# #UNINDENT# } , expect_errors = True ) #NEWLINE# self . assertTrue ( ( 'application/json' in response . headers [ 'content-type' ] ) ) #NEWLINE# self . assertEqual ( response . status_int , 401 )