Rewrite captcha test to python