'Context manager for mocking login.
Patches VThrottledLogin to always return a mock with the provided
name and cookie value'

def mock_login(self, name='test', cookie='cookievaluehere'):

    account = MagicMock()
    account.name = name
    account.make_cookie.return_value = cookie
    return patch.object(VThrottledLogin, 'run', return_value=account)
