Changeset 3606 in products for quintagroup.pfg.captcha/trunk
- Timestamp:
- Oct 25, 2012 10:12:14 AM (10 years ago)
- Location:
- quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha/__init__.py
r3168 r3606 24 24 permission=ADD_PERMISSION, 25 25 extra_constructors=constructors, 26 fti=ftis, 27 ).initialize(context) 26 fti=ftis,).initialize(context) -
quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha/field.py
r3430 r3606 9 9 from Products.PloneFormGen.content.fieldsBase import BaseFormField 10 10 from Products.PloneFormGen.content.fieldsBase \ 11 11 import BaseFieldSchemaStringDefault 12 12 13 13 from quintagroup.pfg.captcha.config import PROJECTNAME … … 57 57 # set a preconfigured field as an instance attribute 58 58 self.fgField = StringField('fg_string_field', 59 searchable=0,60 required=1,61 write_permission=View,62 validators=('isCaptchaCorrect',),63 widget=CaptchaWidget(),64 )59 searchable=0, 60 required=1, 61 write_permission=View, 62 validators=('isCaptchaCorrect',), 63 widget=CaptchaWidget(), 64 ) 65 65 66 66 registerATCT(CaptchaField, PROJECTNAME) -
quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha/setuphandlers.py
r3168 r3606 21 21 if cftype and getattr(cftype, 'product', "") == "qPloneCaptchaField": 22 22 catalog = plone_tools.catalog() 23 captcha_fields = [(cf.id, cf.getObject().aq_parent) \23 captcha_fields = [(cf.id, cf.getObject().aq_parent) 24 24 for cf in catalog.search( 25 25 {'portal_type': 'CaptchaField'})] 26 26 logger.info("Old Products.qPloneCaptchaField fields collected.") 27 27 -
quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha/tests/testInstalled.py
r3430 r3606 26 26 p = p[9:] 27 27 self.assertEqual(p in installed, True, 28 '"%s" product not installed' % p)28 '"%s" product not installed' % p) 29 29 30 30 def testType(self): … … 53 53 paths = filter(None, map(string.strip, spath.split(','))) 54 54 self.assertEqual("qplonecaptchafield" in paths, True, 55 '"qplonecaptchafield" layer not present in "%s" skin' % sname) 55 '"qplonecaptchafield" layer not present ' 56 'in "%s" skin' % sname) 56 57 57 58 … … 70 71 self.assertEqual(visibility, {'view': 'invisible', 71 72 'edit': 'invisible'}, 72 '"%s" field is not hidden, but %s:' % (field, visibility)) 73 '"%s" field is not hidden, but %s:' % 74 (field, visibility)) 73 75 74 76 def testFGField(self): -
quintagroup.pfg.captcha/trunk/quintagroup/pfg/captcha/widget.py
r3168 r3606 13 13 title='Captcha widget', 14 14 description=('Renders captcha image and string input',), 15 used_for=('quintagroup.pfg.captcha.field.CaptchaField',) 16 ) 15 used_for=('quintagroup.pfg.captcha.field.CaptchaField',))
Note: See TracChangeset
for help on using the changeset viewer.