def afterSetUp(self): # app context self.loginAsPortalOwner() # get html output from widget field = Captcha() bound = field.bind(self.portal) widget = CaptchaWidget(bound, self.app.REQUEST) widget.setPrefix('') self.html = widget()
def afterSetUp(self): # prepare context self.loginAsPortalOwner() testPatch() addTestLayer(self) self.captcha_key = self.portal.captcha_key # prepare widget field = Captcha() bound = field.bind(self.portal) self.request = self.app.REQUEST self.widget = CaptchaWidget(bound, self.request) self.widget.setPrefix('') # prepare captcha data self.hashkey = self.portal.getCaptcha() self.request.form['hashkey'] = self.hashkey
class ICCPDCaptchaSchema(Interface): """ """ captcha = Captcha( title=u'Codice di verifica', description=u'Inserisci il codice di verifica che vedi.', )
class IAddForm(Interface): """ Interface for creating a prenotazione """ booking_date = Datetime( title=_('label_booking_time', u'Booking time'), default=None, constraint=check_is_future_date, ) tipology = Choice( title=_('label_tipology', u'Tipology'), required=True, default=u'', vocabulary='rg.prenotazioni.tipologies', ) fullname = TextLine( title=_('label_fullname', u'Fullname'), default=u'', ) email = TextLine( title=_('label_email', u'Email'), required=True, default=u'', constraint=check_valid_email, ) phone = TextLine( title=_('label_phone', u'Phone number'), required=False, default=u'', constraint=check_phone_number, ) mobile = TextLine( title=_('label_mobile', u'Mobile number'), required=False, default=u'', constraint=check_phone_number, ) subject = Text( title=_('label_subject', u'Subject'), default=u'', required=False, ) agency = TextLine( title=_('label_agency', u'Agency'), description=_('description_agency', u'If you work for an agency please specify its name'), default=u'', required=False, ) captcha = Captcha( title=_('label_captcha', u'Type the code from the picture shown below.'), default='', )
class IAddForm(Interface): """ Interface for creating a prenotazione """ fullname = TextLine( title=_('label_fullname', u'Fullname'), default=u'', ) subject = Text( title=_('label_subject', u'Subject'), default=u'', required=False, ) booking_date = Datetime( title=_('label_booking_time', u'Booking time'), default=None, ) agency = TextLine( title=_('label_agency', u'Agency'), description=_('description_agency', u'If you work for an agency please specify its name'), default=u'', required=False, ) phone = TextLine( title=_('label_phone', u'Phone number'), required=False, default=u'', ) email = TextLine( title=_('label_email', u'Email'), default=u'', ) captcha = Captcha( title=_('label_captcha', u'Type the code from the picture shown below.'), default='', )
class ExtendRegistrationForm(Interface): captcha = Captcha( title=(u'Type the code'), description=(u'Type the code from the picture shown below.'))
class ICaptchaSchema(Interface): captcha = Captcha( title=_(u'Type the code'), description=_(u'Type the code from the picture shown below.'))
def testWidgetRegistration(self): cfield = Captcha() request = TestRequest() cwidget = queryMultiAdapter((cfield, request), IInputWidget) self.assertNotEqual(cwidget, None)
class ICaptchaFormlibFormSchema(Interface): label = TextLine(title=u'Label', required=False) captcha = Captcha(title=u'Type the code')