Changeset 1991 in products


Ignore:
Timestamp:
Mar 24, 2010 1:06:44 PM (14 years ago)
Author:
mylan
Message:

#172: Tests: Force captcha dictionary patching only when it needed

Location:
quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/base.py

    r1984 r1991  
    1212from Products.PloneTestCase.PloneTestCase import portal_owner 
    1313from Products.PloneTestCase.PloneTestCase import default_password 
     14from Products.CMFCore.utils import getToolByName 
    1415 
    1516from quintagroup.captcha.core.config import * 
     17from quintagroup.captcha.core import utils 
    1618from quintagroup.captcha.core.utils import getWord, decrypt, parseKey, encrypt1 
    1719 
    18 # PATCH dictionary for captcha testing 
    19 from Products.CMFCore.utils import getToolByName 
    20 class TestData(object): 
    21     words = """heart 
     20PATCH_WORDS = """heart 
    2221glass 
    2322blue 
     
    2524burn 
    2625""" 
     26def testPatch(): 
     27    # PATCH dictionary for captcha testing 
     28    class TestData(object): 
     29        words = PATCH_WORDS 
    2730 
    28 from quintagroup.captcha.core import utils 
    29 utils.basic_english = TestData() 
    30 utils.CAPTCHAS_COUNT = len(utils.basic_english.words.split()) 
    31 # END OF PATCH 
     31    utils.basic_english = TestData() 
     32    utils.CAPTCHAS_COUNT = len(utils.basic_english.words.split()) 
     33    # END OF PATCH 
    3234 
    3335@onsetup 
  • quintagroup.captcha.core/trunk/quintagroup/captcha/core/tests/testWidget.py

    r1975 r1991  
    77 
    88NOT_VALID = re.compile("Please re\-enter validation code") 
     9 
     10# patch to use test images and dictionary 
     11testPatch() 
    912 
    1013class TestCaptchaWidget(ptc.FunctionalTestCase): 
Note: See TracChangeset for help on using the changeset viewer.