Changeset 2447 in products for quintagroup.captcha.core
- Timestamp:
- Jun 2, 2010 11:04:46 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testConfiglet.py
r2265 r2447 94 94 95 95 96 class TestConfigletView(ptc.FunctionalTestCase): 97 98 def afterSetUp(self): 99 self.loginAsPortalOwner() 100 self.addProduct(PRODUCT_NAME) 101 self.view = self.publish(self.portal.id+'/prefs_captchas_setup_form', 102 portal_owner+":"+default_password).getBody() 103 104 def matchinput(self, name): 105 return re.match('.*<input\s+[^\>]*name=\"%s\"[^>]*>' % name, 106 self.view, re.I|re.S) 107 108 def test_basic_form(self): 109 form = re.match('.*<form\s+[^\>]*action=\"[^\"]*?prefs_captchas_setup_form\"[^>]*>', 110 self.view, re.I|re.S) 111 self.assertNotEqual(form, None, 112 "No 'Plone Captchas Setup' form present on the configlet view") 113 self.assertNotEqual(self.matchinput('form\.button\.form_submit'), None, 114 "No submit button on the form") 115 self.assertNotEqual(self.matchinput('static_captchas'), None, 116 "No static/dynamic radio button present on the configlet") 117 118 def test_dynamic(self): 119 params = ["image_size", "background", "font_color", 120 "period", "amplitude", "random_params"] 121 for param in params: 122 self.assertNotEqual(self.matchinput(param), None, 123 "'%s' form element absence on the configlet form" % param) 124 125 96 126 def test_suite(): 97 127 from unittest import TestSuite, makeSuite 98 128 suite = TestSuite() 99 129 suite.addTest(makeSuite(TestConfiglet)) 130 suite.addTest(makeSuite(TestConfigletView)) 100 131 return suite
Note: See TracChangeset
for help on using the changeset viewer.