def test_image_generate(): captcha = ImageCaptcha() data = captcha.generate('1234') assert hasattr(data, 'read') captcha = WheezyCaptcha() data = captcha.generate('1234') assert hasattr(data, 'read')
def generate_image(cls, content): from captcha.image import WheezyCaptcha image = WheezyCaptcha(width=160, height=80) img_buffer = image.generate(content, format="jpeg") return img_buffer.read()
def generate_image(cls, content): from captcha.image import WheezyCaptcha image = WheezyCaptcha(width=160, height=80) img_buffer = image.generate(content, format='jpeg') return img_buffer.read()
def stress_image(i): image = WheezyCaptcha() d = str(i) os.makedirs(d) for t in texts: image.write(t, os.path.join(d, "%s.jpeg" % t), format="jpeg")