Changeset 3121 in products for quintagroup.formlib.captcha/trunk/quintagroup/formlib/captcha/tests/test_unittests.py
- Timestamp:
- Apr 15, 2011 1:00:00 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.formlib.captcha/trunk/quintagroup/formlib/captcha/tests/test_unittests.py
r2800 r3121 21 21 from quintagroup.formlib.captcha import CaptchaWidget 22 22 23 23 24 @onsetup 24 25 def setup_product(): … … 31 32 32 33 setup_product() 33 ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default', ])34 ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default', ]) 34 35 35 36 … … 79 80 FIELDTAG = '<input\s+[^>]*type=\"text\"\s*[^>]*>' 80 81 self.assertEqual(re.search(FIELDTAG, self.html) is not None, True) 81 82 82 83 83 84 class TestCaptchaWidgetToField(ptc.PloneTestCase): … … 101 102 def testSubmitRightCaptcha(self): 102 103 decrypted = decrypt(self.captcha_key, self.hashkey) 103 key = getWord(int(parseKey(decrypted)['key']) -1)104 key = getWord(int(parseKey(decrypted)['key']) - 1) 104 105 try: 105 106 res = self.widget._toFieldValue(key) 106 107 except ConversionError, e: 107 self.fail("Rised unexpected %s error on right captcha submit" % e.doc()) 108 self.fail("Rised unexpected %s error on right captcha submit" % \ 109 e.doc()) 108 110 else: 109 111 self.assertEqual(res, key) 110 112 111 113 def testSubmitWrongCaptcha(self): 112 114 try: … … 119 121 def testSubmitRightCaptchaTwice(self): 120 122 decrypted = decrypt(self.captcha_key, self.hashkey) 121 key = getWord(int(parseKey(decrypted)['key']) -1)123 key = getWord(int(parseKey(decrypted)['key']) - 1) 122 124 self.widget._toFieldValue(key) 123 125 try:
Note: See TracChangeset
for help on using the changeset viewer.