#NEWLINE# def test_in_cache( self , mock_get_user , mock_config ) : #NEWLINE# #INDENT# request = MagicMock ( ) #NEWLINE# request . _cached_user = 'my_user' #NEWLINE# user = get_user ( mock_get_user ) #NEWLINE# self . assertFalse ( mock_get_user . called , '_get_user should not have been called when the user object is in cache' ) #NEWLINE# self . assertEqual ( user , 'my_user' , 'The user in cache should be returned' )