Changeset 2542 in products


Ignore:
Timestamp:
Jun 16, 2010 3:26:04 PM (9 years ago)
Author:
mylan
Message:

#216: Fixed #5 issue, added test (from http://plone.org/products/plone-comments/issues/5)

Location:
quintagroup.captcha.core/trunk/quintagroup/captcha/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/skins/captcha_core/captcha_widget.pt

    r2034 r2542  
    33     i18n:domain="quintagroup.captcha.core" 
    44     tal:define="Iterator python:modules['Products.CMFPlone'].IndexIterator; 
    5                  tabindex python:Iterator(mainSlot=False)"> 
     5                 tabindex python:Iterator(mainSlot=False); 
     6                 portal_url here/plone_portal_state/portal_url"> 
    67  <div class="field" 
    78       tal:define="hk here/getCaptcha; 
    89                   error errors/key|nothing" 
    9        tal:attributes="class python:test(error, 'field error', 'field')"> 
     10       tal:attributes="class python:error and 'field error' or 'field'"> 
    1011     <input type="hidden" 
    1112            name="hashkey" 
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testStatic.py

    r1984 r2542  
    4545        self.assertTrue(index >= 1 and index <= CAPTCHAS_COUNT) 
    4646        # encrypted key must be equals to title of the image 
    47         key = getWord( index-1 )  
     47        key = getWord( index-1 ) 
    4848        img = getattr(self.portal, '%s.jpg' % index) 
    4949        self.assertTrue(encrypt1(key) == img.title) 
     
    6262        self.assertTrue(obj_html == img_html, "Image get by getCaptchaImage script " \ 
    6363            "is differ from image get by index (after parsing decrypted key)") 
    64  
     64         
    6565 
    6666class TestStaticValidator(ptc.PloneTestCase): 
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testWidget.py

    r2019 r2542  
    7979        self.assert_(NOT_VALID.search(response)) 
    8080 
     81    def testCaptchaWidget(self): 
     82        # captcha core related issue, described in 
     83        # in http://plone.org/products/plone-comments/issues/5 
     84        resp = self.publish(self.portal.absolute_url(1)+"/captcha_widget") 
     85        self.assertEqual(resp.status / 100, 2) 
    8186 
    8287def test_suite(): 
Note: See TracChangeset for help on using the changeset viewer.