#NEWLINE# def test_jwt_login_with_expired_token( self ) : #NEWLINE# #INDENT# '\n        Ensure JWT login view works even if expired token is provided\n        ' #NEWLINE# payload = utils . jwt_payload_handler ( self . user ) #NEWLINE# payload [ 'exp' ] = 1 #NEWLINE# token = utils . jwt_encode_handler ( payload ) #NEWLINE# auth = 'Bearer {0}' . format ( token ) #NEWLINE# response = self . client . post ( '/auth-token/' , json . dumps ( self . data ) , content_type = 'application/json' , HTTP_AUTHORIZATION = auth ) #NEWLINE# response_content = json . loads ( smart_text ( token . content ) ) #NEWLINE# decoded_payload = utils . jwt_decode_handler ( response_content [ 'token' ] ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( decoded_payload [ 'username' ] , self . username )