Example #1
0
    def test_image_generate():
        captcha = ImageCaptcha()
        data = captcha.generate('1234')
        assert hasattr(data, 'read')

        captcha = WheezyCaptcha()
        data = captcha.generate('1234')
        assert hasattr(data, 'read')
Example #2
0
    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()
Example #3
0
 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()
Example #4
0
 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")