Ignore:
Timestamp:
Apr 15, 2011 1:00:00 PM (13 years ago)
Author:
vmaksymiv
Message:

pep8 fixes

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

Legend:

Unmodified
Added
Removed
  • quintagroup.formlib.captcha/trunk/quintagroup/formlib/captcha/tests/test_doctests.py

    r2806 r3121  
    1515from quintagroup.captcha.core.tests.testWidget import addTestLayer 
    1616 
     17 
    1718class FormlibCaptchaLayer(PloneSite): 
    1819    @classmethod 
     
    2930    def tearDown(cls): 
    3031        pass 
    31      
    32 ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default',]) 
     32 
     33ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default', ]) 
     34 
    3335 
    3436class FormlibCaptchaTestCase(ptc.FunctionalTestCase): 
     
    4446        self.hashkey = self.portal.getCaptcha() 
    4547        decrypted = decrypt(captcha_key, self.hashkey) 
    46         self.captcha_word = getWord(int(parseKey(decrypted)['key'])-1 ) 
     48        self.captcha_word = getWord(int(parseKey(decrypted)['key']) - 1) 
    4749 
    4850 
     
    5456            'README.txt', package='quintagroup.formlib.captcha', 
    5557            test_class=FormlibCaptchaTestCase, 
    56             optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS), 
    57              
     58            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | \ 
     59                        doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS), 
    5860        ]) 
    5961 
  • quintagroup.formlib.captcha/trunk/quintagroup/formlib/captcha/tests/test_unittests.py

    r2800 r3121  
    2121from quintagroup.formlib.captcha import CaptchaWidget 
    2222 
     23 
    2324@onsetup 
    2425def setup_product(): 
     
    3132 
    3233setup_product() 
    33 ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default',]) 
     34ptc.setupPloneSite(extension_profiles=['quintagroup.captcha.core:default', ]) 
    3435 
    3536 
     
    7980        FIELDTAG = '<input\s+[^>]*type=\"text\"\s*[^>]*>' 
    8081        self.assertEqual(re.search(FIELDTAG, self.html) is not None, True) 
    81          
     82 
    8283 
    8384class TestCaptchaWidgetToField(ptc.PloneTestCase): 
     
    101102    def testSubmitRightCaptcha(self): 
    102103        decrypted = decrypt(self.captcha_key, self.hashkey) 
    103         key = getWord(int(parseKey(decrypted)['key'])-1 ) 
     104        key = getWord(int(parseKey(decrypted)['key']) - 1) 
    104105        try: 
    105106            res = self.widget._toFieldValue(key) 
    106107        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()) 
    108110        else: 
    109111            self.assertEqual(res, key) 
    110          
     112 
    111113    def testSubmitWrongCaptcha(self): 
    112114        try: 
     
    119121    def testSubmitRightCaptchaTwice(self): 
    120122        decrypted = decrypt(self.captcha_key, self.hashkey) 
    121         key = getWord(int(parseKey(decrypted)['key'])-1 ) 
     123        key = getWord(int(parseKey(decrypted)['key']) - 1) 
    122124        self.widget._toFieldValue(key) 
    123125        try: 
Note: See TracChangeset for help on using the changeset viewer.