'Context manager for mocking a failed captcha.'

def failed_captcha(self):

    return contextlib.nested(patch.object(validator, 'need_provider_captcha', return_value=True), patch.object(g.captcha_provider, 'validate_captcha', return_value=False))
