def test_custom_generator(request):
    class CaptchaTestModelForm(forms.ModelForm):
        subject = forms.CharField(max_length=100)
        sender = forms.EmailField()
        captcha = CaptchaField(generator=lambda: ("111111", "111111"))

        class Meta:
            model = User
            fields = ("subject", "sender", "captcha")

    return _test(request, CaptchaTestModelForm)